ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Setting joint velocity in Gazebo

asked 2014-01-16 01:05:04 -0500

SpiderRico gravatar image

updated 2014-01-28 17:06:36 -0500

ngrennan gravatar image

Hello all,

I'm trying to simulate an obstacle avoiding robot in gazebo. I've been following this tutorial.

The problem is that this tutorial uses the following function in order to move the robot.

SetForce(0, torque);

The problem with that is it eventually makes robot to spin.

So i looked in API ref and found

SetVelocity(0, vel);

Code compiles just fine however, this doesn't seem to have any effect on model. So how can I set velocity of wheels from a plugin ?

edit retag flag offensive close merge delete

Comments

This question is quite Gazebo-specific. You might get better feedback if you ask it on answers.gazebo.com

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2014-01-16 06:03:38 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2014-01-19 13:35:33 -0500

The velocity controls will not respond unless the max force limit is large. Edit your sdf to increase the limit or programatically use setMaxForce() to increase the force to a large value. Gazebo will work within these limits to try and instantaneously accelerate your joint to those speeds, so you need no force limits on your joints if you are working on velocities.

edit flag offensive delete link more

Comments

Thank you. I actually asked the same question in gazebosim and got the same answer. Forgot about this one :)

SpiderRico gravatar image SpiderRico  ( 2014-01-20 00:41:26 -0500 )edit
0

answered 2014-01-16 01:56:06 -0500

davinci gravatar image

You probably need a controller for that, I think it is not possible to directly control the velocity. http://gazebosim.org/wiki/Tutorials/1.3/intermediate/pid_control_joint

Edit: it might be possible, in this example it is controlled: http://gazebosim.org/wiki/Tutorials/1.3/intermediate/control_model

But btw: see answers.gazebosim.org for gazebo questions.

edit flag offensive delete link more

Comments

The problem with this->model->SetLinearVel(math::Vector3(vel, 0, 0)); is that it sets the velocity for themodel. I want to set velocity for each wheel separately.

SpiderRico gravatar image SpiderRico  ( 2014-01-16 02:16:22 -0500 )edit

Joint commands can be set without a controller. Force and velocity commands require calling SetForce in advance (as the OP mentions), and it's possible to set the joint position with SetAngle, but here you bypass the physics and enforce perfect position control.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2014-01-16 06:02:10 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-01-16 01:05:04 -0500

Seen: 4,569 times

Last updated: Jan 19 '14