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

Used the fabs function to compute the velocity of each joint (speed must always be positive).

parent 014e64d0
No related branches found
No related tags found
1 merge request!4Filtered localization
......@@ -215,7 +215,7 @@ void CJointsCartModule::initialize_action_msg(sensor_msgs::JointState &solution)
for(j=0;j<this->current_angles.name.size();j++)
{
if(this->current_angles.name[j]==this->joints_traj_msg.trajectory.joint_names[i])
this->joints_traj_msg.trajectory.points[0].velocities[i]=(this->current_angles.position[j]-this->joints_traj_msg.trajectory.points[0].positions[i])/this->motion_time;
this->joints_traj_msg.trajectory.points[0].velocities[i]=fabs(this->current_angles.position[j]-this->joints_traj_msg.trajectory.points[0].positions[i])/this->motion_time;
}
}
this->joint_state_access.exit();
......
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