Home | Tutorials | Wiki | Issues
Ask Your Question

gazebo simulation with payload

asked 2019-09-10 08:06:35 -0500

ycho80 gravatar image

I am running ubuntu 16.04 and kinetic kame.

I am simulating a robotic arm with payload and want to apply payload in runtime. I used an external force instead of payload but the direction of the force is changed by rotating the robotic arm. For the payload, I would like to apply payload/force to the direction of the center of earth.

Could you give me some advice on it? Or it would be great if I could change mass of link in runtime like after 10 seconds since I run the simulation.

Appreciate it in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-10 09:33:35 -0500

kumpakri gravatar image

You can apply force on any link in the simulation using the service call

rosservice call /gazebo/apply_body_wrench "body_name: '<model>::<link>'
reference_frame: '<model>::<link>'
reference_point: {x: 0.0, y: 0.0, z: 0.0}
  force: {x: 0.0, y: 100.0, z: 0.0}
  torque: {x: 0.0, y: 0.0, z: 0.0}
start_time: {secs: 0, nsecs: 0}
duration: {secs: 5, nsecs: 0}"

If you write the name of your link into this command it will apply force of 100 N on this link in y axis for 5 seconds.

You can also change the mass of a link using some model plugin. The Gazebo API provides this method to change the mass of a link.

edit flag offensive delete link more


Thank you for the quick answer. 1. I used the rosservice but the direction of force is changed by rotating the robotic arm. I just want to apply force to the direction of ground. Would it be possible? 2. Additionally, it seems that the reference_frame is ignore for the position of force and torque. When I used the rosservice, I had to use world_coordinates for the position of force and torque. Is there any way I can use local coordinates system for the position of force and torque?

ycho80 gravatar imageycho80 ( 2019-09-10 10:01:17 -0500 )edit

the only reference frame I am able to put in the command without errors is 'world' and it gives me a force acting in global axis on the center of the body (so -z would be direction to the ground no matter what orientation of the link). I suspect this service might be dependant on your tf configuration (the transformations of reference frames must be broadcasted).

kumpakri gravatar imagekumpakri ( 2019-09-10 10:33:35 -0500 )edit

Thank you for the response. The test result was the same when I used 'world' and 'model::link" for my reference_frame for the rosservice. Just want to make sure. If I set up the force like {x: 0.0, y: 0.0, z: -10} for 10 seconds and reference_point is center of mass for a link, then the force is applied to the center of mass of the link and the direction of the force is to the ground. The direction of the force is constant even though the orientation of the link is changed. Am I right?

ycho80 gravatar imageycho80 ( 2019-09-10 17:25:02 -0500 )edit

It works in my simulations like you described. It should be easy to confirm in your simulation. Just apply the force on the link for different orientations of the link and see how it behaves.

kumpakri gravatar imagekumpakri ( 2019-09-11 03:53:53 -0500 )edit

Thank you for the response and it works in my simulations like you explained. I appreciate it.

ycho80 gravatar imageycho80 ( 2019-09-11 10:00:26 -0500 )edit

Can I apply multiple external forces at a same time by using rosservice?

ycho80 gravatar imageycho80 ( 2019-09-11 10:57:06 -0500 )edit

You can sum the multiple external forces if they are in the same coordinate frame acting in the same point. Anything else would probably require some transformations. If you have any further question I would recommend to post a new question with details.

kumpakri gravatar imagekumpakri ( 2019-09-12 06:54:36 -0500 )edit

Thanks. I just posted a new questions with details. Would appreciate it if you give me some hints.

ycho80 gravatar imageycho80 ( 2019-09-12 11:21:36 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-09-10 08:06:35 -0500

Seen: 56 times

Last updated: Sep 10