Skip to content

Commit

Permalink
Merge pull request robotology#59 from martinaxgloria/fix/positionDire…
Browse files Browse the repository at this point in the history
…ctCallback

Fix positionDirect and velocity callbacks within ControlBoard_nws_ros2
  • Loading branch information
elandini84 authored Sep 13, 2023
2 parents 437a6a0 + ed12374 commit 3912b2a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ void ControlBoard_nws_ros2::positionDirectTopic_callback(const yarp_control_msgs
std::vector<double> convertedPos;
std::vector<int> selectedJoints;

for(size_t i=0; i<noJoints ? m_subdevice_joints : msg->positions.size(); i++){
for(size_t i=0; i<(noJoints ? m_subdevice_joints : msg->positions.size()); i++){
size_t index = noJoints ? i : m_quickJointRef[msg->names[i]];
if(!noJoints) {selectedJoints.push_back(index);}
m_iAxisInfo->getJointType(index, jType);
Expand Down Expand Up @@ -314,7 +314,7 @@ void ControlBoard_nws_ros2::velocityTopic_callback(const yarp_control_msgs::msg:
std::vector<int> selectedJoints;
std::vector<double> convertedAccel;

for(size_t i=0; i<noJoints ? m_subdevice_joints : msg->velocities.size(); i++){
for(size_t i=0; i<(noJoints ? m_subdevice_joints : msg->velocities.size()); i++){
size_t index = noJoints ? i : m_quickJointRef[msg->names[i]];
if(!noJoints) {selectedJoints.push_back(index);}
m_iAxisInfo->getJointType(index, jType);
Expand Down

0 comments on commit 3912b2a

Please sign in to comment.