0
$\begingroup$

Gazebo Answers logo

I'm working on a model plugin for controlling an omnidirectional drive base with four powered caster wheels. I want to control the position of the steering joints and the velocity of the wheel joints. The problem with this setup is that the wheel joints refuse to move.

Consider the following piece of code which is part on the callback for the world update begin event:

if (joint_name.find("rotation") != std::string::npos) {
  joint->SetPosition(0, command_msg_.desired.positions[i]);
} else {
  joint->SetVelocity(0, command_msg_.desired.velocities[i]);
}
  • If I execute the first branch for all joints, then all joints will move to the commanded positions
  • If I execute the second branch for all joints, then all joints will move at the commanded velocity
  • If I keep the if statement (I've confirmed that the right branch is executed for each joint), then the positions will be respected, but the velocities will not. ie the wheels do not rotate

Any ideas what might be going on here?


Originally posted by nlamprian on Gazebo Answers with karma: 833 on 2020-03-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Setting an effort limit seems to have done the trick

joint->SetParam("fmax", 0, max_torque_);
joint->SetParam("vel", 0, command_msg_.desired.velocities[i]);

Originally posted by nlamprian with karma: 833 on 2020-03-19

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.