Commit d778cd46 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 4cca5838
......@@ -17,8 +17,8 @@ IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_C_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_C_FLAGS_RELEASE "-O3")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3")
ADD_SUBDIRECTORY(src/)
ADD_SUBDIRECTORY(test/)
......
......@@ -27,7 +27,7 @@ CSegwayRMP400::CSegwayRMP400(const std::string serial1, const std::string serial
scan_ftdi_for_segways();
for (int i = 0; i < serial_ftdi_segway_devices_.size(); i++) {
for (unsigned int i = 0; i < serial_ftdi_segway_devices_.size(); i++) {
std::string serial = serial_ftdi_segway_devices_[i];
if ((serial != serial1) && (serial != serial2))
......@@ -43,7 +43,7 @@ CSegwayRMP400::scan_ftdi_for_segways()
std::vector<int> ftdi_devs = ftdi_server_->get_ids_by_description(CSegwayRMP200::description);
for (int i = 0;i < ftdi_devs.size();i++) {
for (unsigned int i = 0;i < ftdi_devs.size();i++) {
serial_ftdi_segway_devices_.push_back(
ftdi_server_->get_serial_number(ftdi_devs.at(i)));
}
......@@ -55,7 +55,7 @@ CSegwayRMP400::scan_ftdi_for_segways()
void
CSegwayRMP400::start()
{
for (int i = 0;i < NUM_SEGWAY_200 ;i++) {
for (unsigned int i = 0;i < NUM_SEGWAY_200 ;i++) {
try
{
......@@ -66,7 +66,7 @@ CSegwayRMP400::start()
{
// Something failed while starting engines
// clean up previous (if any) started engine
for (int i = 0; i < segways_.size(); i++) {
for (unsigned int i = 0; i < segways_.size(); i++) {
segways_[i]->stop();
delete segways_[i];
}
......@@ -82,7 +82,7 @@ CSegwayRMP400::start()
std::ostream &
operator<< (std::ostream& data, CSegwayRMP400 & segway)
{
for (int i=0; i<segway.segways_.size(); i++)
for (unsigned int i=0; i<segway.segways_.size(); i++)
{
data << "Segway unit: " << i << std::endl;
data << "Pitch angle: " << segway.segways_[i]->get_pitch_angle() << " degrees" << std::endl;
......@@ -112,7 +112,9 @@ operator<< (std::ostream& data, CSegwayRMP400 & segway)
data << "UI battery voltage: " << segway.segways_[i]->get_ui_battery_voltage() << " V" << std::endl;
data << "Powerbase battery voltage: " << segway.segways_[i]->get_powerbase_battery_voltage() << " V" << std::endl << std::endl;
}
data << std::endl;
data << std::endl;
return data;
}
void
......@@ -121,7 +123,7 @@ CSegwayRMP400::set_operation_mode(op_mode mode)
if (mode == balance)
throw RMP400InvalidBalanceModeOperation(_HERE_);
for (int i=0;i < segways_.size();i++)
for (unsigned int i=0;i < segways_.size();i++)
{
segways_[i]->set_operation_mode(mode);
usleep(10000);
......@@ -217,7 +219,7 @@ CSegwayRMP400::reset_integrators()
need_to_be_connected();
do {
for (int i=0; i < segways_.size(); i++) {
for (unsigned int i=0; i < segways_.size(); i++) {
segways_[i]->reset_right_wheel_integrator();
segways_[i]->reset_left_wheel_integrator();
segways_[i]->reset_yaw_integrator();
......@@ -252,7 +254,7 @@ CSegwayRMP400::move(float vT, float vR)
{
need_to_be_connected();
for (int i=0 ;i < segways_.size(); i++)
for (unsigned int i=0 ;i < segways_.size(); i++)
segways_[i]->move(vT,vR);
}
......@@ -261,7 +263,7 @@ CSegwayRMP400::stop()
{
need_to_be_connected();
for (int i=0;i < segways_.size();i++)
for (unsigned int i=0;i < segways_.size();i++)
segways_[i]->stop();
status_ = rmp400_off;
......@@ -269,6 +271,6 @@ CSegwayRMP400::stop()
CSegwayRMP400::~CSegwayRMP400()
{
for (int i=0;i < segways_.size(); i++)
for (unsigned int i=0;i < segways_.size(); i++)
delete segways_[i];
}
......@@ -10,7 +10,7 @@
#define RMP400_b 0.54 // distance between weels for one rmp unit in meters
#define RMP200_DEFAULT_WHEEL_RADIUS 0.24
const int NUM_SEGWAY_200 = 2;
const unsigned int NUM_SEGWAY_200 = 2;
enum SegwayRMP400_status { rmp400_off, rmp400_connected };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment