allegro_hand_ros/allegro_hand_controllers/src/allegro_node_grasp.cpp
void AllegroNodeGrasp::setJointCallback(const sensor_msgs::JointState &msg) {
  mutex->lock();

  for (int i = 0; i < DOF_JOINTS; i++)
    desired_position[i] = msg.position[i];
  mutex->unlock();

  pBHand->SetJointDesiredPosition(desired_position);
  pBHand->SetMotionType(eMotionType_JOINT_PD);
}
// Called when a desired joint position message is received
Called when a desired joint position message is received
Called when a desired joint position message is received
void AllegroNodeGrasp::setJointCallback(const sensor_msgs::JointState &msg) {
  mutex->lock();
  for (int i = 0; i < DOF_JOINTS; i++)
    desired_position[i] = msg.position[i];
  mutex->unlock();
  pBHand->SetJointDesiredPosition(desired_position);
  pBHand->SetMotionType(eMotionType_JOINT_PD);
}
void AllegroNodeGrasp :: setJointCallback ( const sensor_msgs :: JointState & msg ) { mutex -> lock ( ) ; for ( int i = 0 ; i < DOF_JOINTS ; i ++ ) desired_position [ i ] = msg . position [ i ] ; mutex -> unlock ( ) ; pBHand -> SetJointDesiredPosition ( desired_position ) ; pBHand -> SetMotionType ( eMotionType_JOINT_PD ) ; }
Called when a desired joint position message is received
Called when a desired joint position message is received