I just load the plugin, as it is in the example .it shows that the plugin being loaded
and after the simulation starts, I expected it to just apply the force whenever I make contact between left_end_effector and any link, but it doesnt work
No, that is not how the plugin works.
The C++ source isn't too pretty, but here the plugin creates two std_srvs::Empty
services called on
and off
. You can use those to turn the vacuum on, and to turn it off again. Only in the on state will the 'gripper' exert a force on any other links that are close to it (see these lines that calculate the force).
So the workflow for this plugin is as follows (for a pick-and-place kind of application fi):
- put virtual vacuum gripper close to to-be-gripped object (or really: link)
- call the
on
service to "activate suction" (start exerting force on the close-by link) - move the vacuum gripper somewhere else
- call the
off
service to "deactivate suction"
After the last step, the object should no longer be attached to the vacuum gripper link.
Again thank you so much gvhoorn, how can I call this "on service"?
Do a rosservice list
to show you where the service is exactly located, then use rosservice call /path/to/service <tab tab>
to auto-complete the request. std_srvs::Empty
services don't need any input arguments, so the request should be empty.
You can of course also call these services in a regular C++ or Python program using a Service Client (C++ tutorial, Python tutorial, but use a std_srvs::Empty
service client).
You'll have to be a bit more specific: do you not understand how to interact with the plugin, or do you not understand how the plugin internally communicates with Gazebo to set / update the simulation state?
Thank you so much gvdhoorn, When I run the simulation, and try to make contact between the left_end_effector and the link I want to attach , the vacuum gripper does not apply force.
But how do you exactly "try to make contact"? Do you call the
on
service?Again thank you so much gvhoorn, how can I call this "on service"?
I just load the plugin, as it is in the example it shows that the plugin being loaded and after the simulation starts, I expected it to just apply the force whenever I make contact between left_end_effector and any link, but it doesnt work