Skip to content
Snippets Groups Projects
Commit be5ec9bb authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Modified the main CMakeLists.txt to set the compiler flags for the C++...

Modified the main CMakeLists.txt to set the compiler flags for the C++ compiler instead of the C compiler.
Solved some compilation warnings that appeared.
parent 8e10ed89
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,8 @@ IF (NOT CMAKE_BUILD_TYPE) ...@@ -17,8 +17,8 @@ IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "DEBUG") SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF (NOT CMAKE_BUILD_TYPE) ENDIF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_C_FLAGS_DEBUG "-g -Wall") SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_C_FLAGS_RELEASE "-O3") SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)
......
...@@ -56,7 +56,6 @@ int main(int argc, char *argv[]) ...@@ -56,7 +56,6 @@ int main(int argc, char *argv[])
{ {
//operational variables //operational variables
CSegwayRMP200 *segway; CSegwayRMP200 *segway;
CFTDIServer *ftdi_server=CFTDIServer::instance();
string serial_number; string serial_number;
unsigned int ii=0; unsigned int ii=0;
unsigned int jj=0; unsigned int jj=0;
......
...@@ -49,7 +49,6 @@ int main(int argc, char *argv[]) ...@@ -49,7 +49,6 @@ int main(int argc, char *argv[])
{ {
CSegwayRMP200 *segway = NULL; CSegwayRMP200 *segway = NULL;
std::list<std::string> events; std::list<std::string> events;
CFTDIServer *ftdi_server=CFTDIServer::instance();
CEventServer *event_server=CEventServer::instance(); CEventServer *event_server=CEventServer::instance();
std::string serial_number,cable_disconnected,power_off; std::string serial_number,cable_disconnected,power_off;
bool connected=false; bool connected=false;
......
...@@ -256,7 +256,6 @@ bool CSegwayRMP200::read_packet(segway_packet *packet,int *packet_len) ...@@ -256,7 +256,6 @@ bool CSegwayRMP200::read_packet(segway_packet *packet,int *packet_len)
void CSegwayRMP200::parse_packet(segway_packet *packet) void CSegwayRMP200::parse_packet(segway_packet *packet)
{ {
short int command; short int command;
int i=0;
if(this->compute_checksum(packet)!=packet->data[17]) if(this->compute_checksum(packet)!=packet->data[17])
{ {
...@@ -314,6 +313,8 @@ void *CSegwayRMP200::start_read_thread(void *param) ...@@ -314,6 +313,8 @@ void *CSegwayRMP200::start_read_thread(void *param)
CSegwayRMP200 *segway = (CSegwayRMP200 *) param; CSegwayRMP200 *segway = (CSegwayRMP200 *) param;
segway->read_thread(); segway->read_thread();
pthread_exit(NULL);
} }
void CSegwayRMP200::read_thread(void) void CSegwayRMP200::read_thread(void)
...@@ -343,8 +344,6 @@ void CSegwayRMP200::read_thread(void) ...@@ -343,8 +344,6 @@ void CSegwayRMP200::read_thread(void)
end=true; end=true;
} }
} }
pthread_exit(NULL);
} }
void *CSegwayRMP200::start_command_thread(void *param) void *CSegwayRMP200::start_command_thread(void *param)
...@@ -352,11 +351,13 @@ void *CSegwayRMP200::start_command_thread(void *param) ...@@ -352,11 +351,13 @@ void *CSegwayRMP200::start_command_thread(void *param)
CSegwayRMP200 *segway = (CSegwayRMP200 *) param; CSegwayRMP200 *segway = (CSegwayRMP200 *) param;
segway->command_thread(); segway->command_thread();
pthread_exit(NULL);
} }
void CSegwayRMP200::command_thread(void) void CSegwayRMP200::command_thread(void)
{ {
segway_packet packet={0xF0,0x55,0x00,0x00,0x00,0x00,0x04,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; segway_packet packet={{0xF0,0x55,0x00,0x00,0x00,0x00,0x04,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}};
std::vector<unsigned char> command; std::vector<unsigned char> command;
int exception_count=0; int exception_count=0;
bool end=false; bool end=false;
...@@ -413,8 +414,6 @@ void CSegwayRMP200::command_thread(void) ...@@ -413,8 +414,6 @@ void CSegwayRMP200::command_thread(void)
end=true; end=true;
} }
} }
pthread_exit(NULL);
} }
void *CSegwayRMP200::heartbeat_thread(void *param) void *CSegwayRMP200::heartbeat_thread(void *param)
...@@ -673,9 +672,6 @@ TSegwayRMP200Status CSegwayRMP200::get_status(void) ...@@ -673,9 +672,6 @@ TSegwayRMP200Status CSegwayRMP200::get_status(void)
status.right_torque = this->right_torque; status.right_torque = this->right_torque;
status.ui_battery = this->ui_battery; status.ui_battery = this->ui_battery;
status.powerbase_battery = this->powerbase_battery; status.powerbase_battery = this->powerbase_battery;
op_mode operation_mode = this->mode;
op_mode hardware_mode = this->hardware_mode;
gain gain_schedule = this->gain_schedule;
return status; return status;
} }
...@@ -844,7 +840,7 @@ void CSegwayRMP200::connect(const std::string& desc_serial) ...@@ -844,7 +840,7 @@ void CSegwayRMP200::connect(const std::string& desc_serial)
void CSegwayRMP200::reset(void) void CSegwayRMP200::reset(void)
{ {
segway_packet packet={0xF0,0x55,0x00,0x00,0x00,0x00,0x04,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; segway_packet packet={{0xF0,0x55,0x00,0x00,0x00,0x00,0x04,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}};
if(this->comm_dev==NULL) if(this->comm_dev==NULL)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment