# Manipulating Position of Conveyor Belt relative to platform in Gazebo and applying body wrench

Hello Everyone,

I created a simple conveyor model in RVIZ (see URDF below)

<?xml version="1.0"?>
<robot name="multipleshapes">
<visual>
<geometry>
<box size="1 4 .01"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="1 4 .01"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>

<visual>
<geometry>
<box size="1 4 .01"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="1 4 .01"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>

<visual>
<geometry>
<box size="1 4 .01"/>
</geometry>
<material name="blue">
<color rgba="0 0 .8 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="1 4 .01"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>

<joint name="base_to_right_leg" type="fixed">
<origin xyz="2 0 0"/>
</joint>

<joint name="base_to_belt" type="prismatic">
<axis xyz="0 1 0"/>
<limit effort="1000.0" lower="0" upper="1" velocity="0.5"/>
<origin xyz="1 0 0"/>
</joint>

</robot>


The plan was to have the blue strip much longer in the y direction so that when it moved, it simulated a conveyor for a long period of time. When I simulated this in RVIZ with the slide for the prismatic joint, the model worked and the belt moved.

Now I need to make a conveyor simulation in Gazebo and I accomplished this before by exerting a force on a different belt, see answer to this question:

Trying to do what I did before, I spawned this Object in gazebo (added in gazebo reference for color):

and applied the wrench on the blue belt:

rosservice call /gazebo/apply_body_wrench '{body_name: "my_object::belt", reference_frame: "my_object::belt", wrench: { force: { x: 0, y: 1, z: 0 } }, start_time: 0, duration: -1 }'


However, it would not move.

I need to have this belt move and effect other robots in gazebo (so that the robots do not move it, but it moves other robots), and I do not know what the best way to have this done is.

I also looked into plugin tutorials, but when I tried it, I was getting errors, so before I go that route, I want to know if there is a simpler way of doing this.

I figured if I have the white platforms surrounding the belt, the robots on the platform/belt will not move the belt relative to the world, but will be effected by the belt's movement.

Am I applying the wrench wrong/making some mistake or is there no simple ...

edit retag close merge delete

Sort by » oldest newest most voted

I can´t tell you why this doesn't work in this case, but as a general remark: Depening on what you're trying to achieve I guess going the way that was proposed in the other question could be a much better idea. What you would usually want to do is to write some code for your conveyor that monitors contacts and excerts forces on objects in touch. That way your conveyor stays where it is, which makes a lot more sense in larger scenarios with multiple conveyors. I have done similar stuff years ago B21 ICIM Factory. There we had palletized conveyors which meant i was setting up a rigid link between the pallet and the conveyor until the pallet runs into the end of the conveyor where the link would be destroyed and the next conveyor takes over. So this is not a physical simulation, but it was working to model the factory at the level we needed.

more