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

Robot with valves in Gazebo

asked 2016-11-09 15:27:19 -0600

cclina gravatar image

I'm quite new to ROS and Gazebo and I would be very grateful if anyone could give me any pointers as to how to add valves to a car-like robot I have simulated in Gazebo. The idea is that given some input the robot will open/close the valves attached to it. I have searched for a similar robot model but could not find one. Any ideas will be very welcome! Thank you very much.

edit retag flag offensive close merge delete


What is supposed to happen in the simulation when the valves open or close?

lucasw gravatar image lucasw  ( 2016-11-09 17:19:41 -0600 )edit

Ideally, water should come out, but any other indication that the valves have opened or closed, such as turning a light on and off, would also work.

cclina gravatar image cclina  ( 2016-11-10 06:47:44 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-11-10 09:53:52 -0600

lucasw gravatar image

Gazebo doesn't have fluid simulation, so it would have to be some other visual indicator involving motion of rigid bodies or lights.

You could have a brightly colored object with no <collision> that is on a linear/prismatic actuator that retracts inside another object that hides it when off, then is set to protrude out and become visible when the valve is on.

Lights aren't yet well integrated, it looks like there is now a pull request to make it possible to attach lights to a robot though that will take a while to make it into a major gazebo release and be integrated with gazebo_ros. It is possible to create a light through the gazebo_ros spawn model service and then turn the light on and off through another service call, and it could also be manually positioned through a gazebo ros topic interface to move around with a mobile robot.

You might also consider only putting visual indicators of this sort in rviz visualizations (a Marker could change color from red to green very easily in rviz) instead of gazebo.

edit flag offensive delete link more

answered 2016-11-13 03:00:32 -0600

Ajith kumar gravatar image

Fluid simulation is not yet implemented in Gazebo. But, you can use some mini objects(just like coal) to move through a pipe. The movement of those objects can be controlled by applying force through setforce utility


and the position of the control valve can be controlled through setposition utility


All you have to do is two things: 1.) Create models as per your wish. 2.) Create a Gazebo node which uses your SDF(or URDF) content to control the objects. Please look at the this page for detailed information. Keep on update us about your progress.

(Additional tips: -Make a Gazebo valve model with bonnet,body as a separate link and valve plug as another link. Make joint connection between them -Try using Gazebo7 which has model editor which will ease your job)

edit flag offensive delete link more

Question Tools



Asked: 2016-11-09 15:27:19 -0600

Seen: 552 times

Last updated: Nov 13 '16