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

Changed the name of the TServoInfo structure to TServoData to avoid conflicts...

Changed the name of the TServoInfo structure to TServoData to avoid conflicts in the gazebo CM510 simulator.
Problems when the motion file does not exists or is invaid. It needs to be checked before calling the parser function.
parent e1a204a9
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -307,7 +307,7 @@ std::vector<std::string> CRobotisMtn::get_motor_models(void) const
return models;
}
TServoInfo CRobotisMtn::get_motor_info(unsigned int servo) const
TServoData CRobotisMtn::get_motor_info(unsigned int servo) const
{
if(servo>this->get_num_servos())
{
......@@ -318,7 +318,7 @@ TServoInfo CRobotisMtn::get_motor_info(unsigned int servo) const
return this->info[servo];
}
std::vector<TServoInfo> CRobotisMtn::get_motor_infos(void) const
std::vector<TServoData> CRobotisMtn::get_motor_infos(void) const
{
return this->info;
}
......
......@@ -23,7 +23,7 @@ typedef struct
double max_angle;
double center_angle;
double max_speed;
}TServoInfo;
}TServoData;
class CRobotisMtn
{
......@@ -33,7 +33,7 @@ class CRobotisMtn
int num_servos;
std::vector<bool> enable;
std::vector<CRobotisPage> pages;
std::vector<TServoInfo> info;
std::vector<TServoData> info;
public:
CRobotisMtn();
CRobotisMtn(CRobotisMtn &mtn);
......@@ -56,8 +56,8 @@ class CRobotisMtn
std::string get_motor_model(unsigned int servo) const;
std::vector<int> get_motor_types(void) const;
std::vector<std::string> get_motor_models(void) const;
TServoInfo get_motor_info(unsigned int servo) const;
std::vector<TServoInfo> get_motor_infos(void) const;
TServoData get_motor_info(unsigned int servo) const;
std::vector<TServoData> get_motor_infos(void) const;
unsigned int get_num_pages(void) const;
CRobotisPage get_page(unsigned int page) const;
void clear(void);
......
......@@ -30,7 +30,10 @@ void MTN::CMtnFileParser::parse(const char *filename)
{
std::ifstream in_file(filename);
if(!in_file.good())
{
std::cerr << "Failed to open the file!!\n";
_exit( -1 );
}
if(this->scanner!=NULL)
delete this->scanner;
try
......
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