Gazebo | Ignition | Community
Ask Your Question

Mixing position and velocity commands in a drive base

asked 2020-03-17 19:26:51 -0600

nlamprian gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-03-19 06:59:25 -0600

nlamprian gravatar image

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]);
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-03-17 19:26:51 -0600

Seen: 38 times

Last updated: Mar 19 '20