Ask Your Question

ROs physical movements

asked 2019-07-05 07:24:35 -0600

Hank470 gravatar image

Hi everyone,

I am currently studying ROS and actually I had my internship in a robotic firm using ROS, controlling robotic arms but the system was already set up when I was there. So I was wondering how physical world is being applied to ROS.

To give an easy example. Suppose we have 2 wheeled mobile robot. One base_link which is a box shaped body and 2 wheels, left and right.

Using joint_state_publisher, I can rotate the wheels by publishing rotation angles between -pi and pi. Using tf (odometry) I can move the base link around, I can even make it move in a circle around a center.

So here is my question, how can I make my robot move as my wheels turn just like a real world car. I mean, I can use tf to move my car, yes, but this is not real. I am just manipulating its location in space and in the meantime I can rotate my wheels or not, it doesn't matter. How can I tell my ROS environment: " Hey this is the surface that you will be moving on. So you will placed on it. And then if I move the wheels, then the whole robot will move and it will travel a distance regarding to the diameter of wheels and the speed will also based on wheels"

So you may say, "Hey you gave your answer already, this is literally how it works, you need a surface etc". What I am wondering is, do I need to write a code and calculate the travel distance simply using (2pir) and then manipulate the tf according to this distance?

To sum up my question, what we see in ROS simulation such as rviz, gazebo or moveit whatsoever, is it just a manipulation of tf? Is something physical happening there? Or can it really understand "Oh this wheel is turning and it is touching to the ground and physically it must travel a distance because this is how it works in real world"

Or let's just answer that question. If you create a basic cylinder and make it roll from A to B, how would you do it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-05 08:02:45 -0600

I'll try and explain this in two cases, first a simulation in gazebo and second a real world robot. This should clear up exactly what ROS is and isn't doing.

In the case of gazebo this is running a full physical simulation of the world so this is working out how the body of the robot moves as the wheels turn. However gazebo can't (shouldn't) tell the ROS TF system exactly where the robot is because this would be cheating. For this you will need some sort of perception system, this could be as simple as wheel odometry which integrates it's movement over time to estimate it's location. Or it could be a full visual SLAM system that creates a map of its environment and localises itself within it. In the case of gazebo (the simulator) this will produce the sensor outputs that are used by some other ROS modes to estimate the robots location.

In the case of an actual robot the localisation nodes should work in exactly the same way except their receiving data from real sensors as opposed to a simulation.

I'm summary there are two key points. In the simulation the robot moves because gazebo is simulating the physics. Secondly and separately ROS is using some sort of perception algorithm to estimate the location of the robot based upon some sensor outputs.

Hope this makes sense.

edit flag offensive delete link more



However gazebo can't (shouldn't) tell the ROS TF system exactly where the robot is because this would be cheating.

Yes, +100 for this.

I always tell my students that they would be using the "eye of god" in that case. We might even go so far as to "forbid" the use of gzclient and of the Gazebo services for interacting with models directly ("hand of god"), as it makes this too tempting.

gvdhoorn gravatar image gvdhoorn  ( 2019-07-05 08:36:03 -0600 )edit

Thank you for explanations, they made at least some things clear but I still have question marks here @PeteBlackerThe3rd . Maybe I should ask my question in that way. Suppose we have a cylinder and this cylinder can roll around its own axis and stay where it is just like a wind turbine OR it can roll and move forward like a barrel. Sow how does gazebo (I would like to say rviz because I want to be able to understand that mechanic before I move to gazebo) know that the cylinder will roll and move forward (and in that matter how does it know how far it will go with every full rotation, can it calculate the distance?) OR roll but stay where it is.

Hank470 gravatar image Hank470  ( 2019-07-05 08:49:51 -0600 )edit

I would like to say rviz because I want to be able to understand that mechanic

just a quick comment: RViz is a pure visualiser. It's not a simulator. So RViz only renders 3D objects with 6D poses. Those poses come from TF.

gvdhoorn gravatar image gvdhoorn  ( 2019-07-05 08:53:07 -0600 )edit

@gvdhoorn thank you, that literally made so many things way more clear. I generally try to teach people what I know, I believe that is the best way to learn something. So I know what kind of questions I will receive so I might be asking dummy questions but even the question is so basic, it can be underestimated and not mentioned in books

Hank470 gravatar image Hank470  ( 2019-07-05 09:00:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-07-05 07:24:35 -0600

Seen: 182 times

Last updated: Jul 05 '19