Skip to content
Snippets Groups Projects
Commit f27e081d authored by Irene Garcia Camacho's avatar Irene Garcia Camacho
Browse files

Minor changes in joints module

parent 60d19e5c
No related branches found
No related tags found
1 merge request!4Filtered localization
......@@ -43,7 +43,7 @@ class CJointsModule : public CHumanoidModule<joints_module::JointsModuleConfig>
CJointsModule(const std::string &name);
/* control functions */
//execute joints trajectory of a vector of servos id
bool execute(std::vector<unsigned int> &servos_id, std::vector<double> &angles, std::vector<double> &speeds, const std::vector<double> &accels=std::vector<double>());
void execute(std::vector<unsigned int> &servos_id, std::vector<double> &angles, std::vector<double> &speeds, const std::vector<double> &accels=std::vector<double>());
//Add servo goal
void add_goal(unsigned int servo_id, double angle, double speed, double acceleration);
//Execute action with servos added (add_servo)
......
......@@ -2,9 +2,6 @@
#define SERVO_ACCEL 0.3
/**
* cambiar funcion is-finished para que tmb tenga en cuenta el flag new_trajectory
*/
CJointsModule::CJointsModule(const std::string &name) : CHumanoidModule(name,JOINTS_MODULE),
joints_trajectory("joint_trajectory_action",name)
{
......@@ -134,7 +131,7 @@ void CJointsModule::reconfigure_callback(joints_module::JointsModuleConfig &conf
this->unlock();
}
bool CJointsModule::execute(std::vector<unsigned int> &servos_id, std::vector<double> &angles, std::vector<double> &speeds,const std::vector<double> &accels)
void CJointsModule::execute(std::vector<unsigned int> &servos_id, std::vector<double> &angles, std::vector<double> &speeds,const std::vector<double> &accels)
{
unsigned int i,j;
bool servo_ok=true;
......@@ -142,13 +139,6 @@ bool CJointsModule::execute(std::vector<unsigned int> &servos_id, std::vector<do
this->lock();
if(this->state==JOINTS_MODULE_IDLE)// trajectory is in progres
{
/*Clear goal*/
/* goal.trajectory.joint_names.clear();
goal.trajectory.points[0].positions.clear();
goal.trajectory.points[0].velocities.clear();
goal.trajectory.points[0].accelerations.clear()*/;
/* clear vector */
// servos_name.clear();
if(accels.size()>0)
{
......@@ -197,8 +187,7 @@ bool CJointsModule::execute(std::vector<unsigned int> &servos_id, std::vector<do
this->new_trajectory=true;
}
this->unlock();
return true;
}
void CJointsModule::execute_goal(void)
......
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