Simulating a car-like robot in Stage
Hi,
I am trying to simulate a car-like robot using Stage. I have a .world file which sets up the environment and the robot. I also have some Controller code which publishes commands to a topic for moving forward and/or turning at some velocity. Finally I have some interface code which subscribes to these commands and publishes to /cmd_vel to make the robot move inside the Stage window. My questions regarding this are:
Is /cmd_vel the topic I should be publishing messages to , for moving the robot around ? Or is it some other topic ? (I assumed it was /cmd_vel as that is the only topic Stage subscribes to.)
Assuming /cmd_vel is the topic I should publish to, I notice that I need to keep publishing (in a loop) to /cmd_vel for the robot to move. I would assume that if I set the velocity to be X, it would keep moving at X, and then stop when I set it to 0. But that is not the case. Is there something I am not understanding here ? (Publishing a velocity to the /cmd_vel once moves it only for a small distance and then stops )
Finally, I did not find enough documentation which would explain what exactly is "angular" velocity in /cmd_vel for a car-like robot ? Is it the Steering angle or the actual angle of the robot ?
Follow-up questions:
In my Car-like robot simulation, I would like to specify different velocities to cmd_vel to move my robot around. So after specifying a velocity V1, I would like the robot to keep moving at V1 till I explicitly specify it to change to velocity V2.
I understand ~/base_watchdog_timeout parameter is a way to specify how long I want my last command to be effective. But setting this parameter would affect other messages published on other topics too.
I was looking for some way to specify in the 'roscpp::publish()' api to specify the rate at which a message should be published, (in a way similar to the '-r' option of the "rostopic pub" command). Any ideas ?
I had a another question regarding /cmd_vel. What is the unit of the linear velocity in /cmd_vel that Stage expects ? Is it meters per sec ?