dynamixel-community/dynamixel_hardware

Velocity control mode doesn't work in dummy mode

Opened this issue · 0 comments

Title says it all. Source code indicates this to be true.

return_type DynamixelHardware::write(const rclcpp::Time & /* time */, const rclcpp::Duration & /* period */)
{
  if (use_dummy_) {
    for (auto & joint : joints_) {
      joint.prev_command.position = joint.command.position;
      joint.state.position = joint.command.position;
    }
    return return_type::OK;
  }

I tried to fix it myself with

if (use_dummy_) {
    for (auto & joint : joints_) {
      joint.prev_command.position = joint.command.position;
      joint.state.position = joint.command.position;
      joint.prev_command.velocity = joint.command.velocity;
      joint.state.velocity = joint.command.velocity;
      
    } 

but no dice.