When you use sim time, the time starts at zero. That's not an error, that's just where time begins when you launch Gazebo. If you do a rostopic echo /clock
, you will see that it's close to zero.
Originally posted by DimitriProsser with karma: 11163 on 2012-01-12
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by DimitriProsser on 2012-01-13:
If you do rostopic echo /clock
, does it show a simulated time properly? Also, try running your node without gazebo and use_sim_time and see if it works then.
Comment by maruchi on 2012-01-13:
Yes, I set "use_sim_time" parameter true
Comment by DimitriProsser on 2012-01-13:
Do you have the "use_sim_time" parameter set to true?
Comment by maruchi on 2012-01-12:
I start them in two separate terminals. Do you think I have to start them in the same launch file ? If I start them in the same launch file, how can I put my cpp file in the lauch file? Could you guide me a tutorial ?
Comment by DimitriProsser on 2012-01-12:
Do you start them in the same launch file or in two separate terminals?
Comment by maruchi on 2012-01-12:
I start gazebo simulation first and then load my controller. When the gazebo simulation start, 'Sim Time' has passed by. When I start my controller, I want to use the 'Sim Time' when my controller loaded. What should I edit in my controller which is written as C++ ?