Hi NKN, unfortunately there is not much documentation about UWSim yet, just what there is on the wiki:
http://www.irs.uji.es/uwsim/wiki/
However, it comes with a set of examples that should be self explanatory, being gotoAbsolutePosition one of them. It requires a nav_msgs/Odometry topic where UWSim is publishing its current pose (via a PATToROSOdom interface), and another nav_msgs/Odometry topic where UWSim is listening for position update messages (via a ROSOdomToPAT interface).
Your scene xml file must include these interfaces and specify the topics, e.g:
<ROSOdomToPAT>
<topic> /pose_update </topic>
<vehicleName> your_vehicle_name </vehicleName>
</ROSOdomToPAT>
<PATToROSOdom>
<topic> /current_pose </topic>
<vehicleName> your_vehicle_name </vehicleName>
</PATToROSOdom>
Note that the default cirs.xml scene does not include the PATToROSOdom, so you need to add it explicitly if you want to use the gotoAbsolutePosition example.
Then, with UWSim running, you should be able to do:
rosrun UWSim gotoVehiclePose /current_pose /pose_update 10 0 0 0 0 0
Hope that helps!
Originally posted by Mario Prats with karma: 291 on 2013-08-29
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by Javier Perez on 2013-09-01:
Just to avoid misleadings, the correct command is gotoAbsolutePosition instead of gotoVehiclePose. So the complete line should be:
rosrun UWSim gotoAbsolutePosition /current_pose /pose_update 10 0 0 0 0 0
Anyway answer is perfect.
Comment by User_810 on 2015-02-23:
Hi, I am not able to add this topic to my cirs.xml file.
I am new to ROS and this is my first package. Can you tell me if I can edit the cirs.xml file?
Also for building it, i used catkin_make command. Is that sufficient?
Comment by Javier Perez on 2015-02-24:
Hi, The lines that mario posted as code should be in your config file (by default cirs.xml). You can, and should, edit cirs.xml as this is the scene configuration file. After editing it you will need a catkin_make install in order to move these config files to a place where uwsim is able to findthem
Comment by User_810 on 2015-02-24:
I did catkin_make. But uwsim doesn't recognize the changes I made.
Comment by Javier Perez on 2015-02-25:
As I said on my previous message you need "catkin_make install" without install you are loading the old xml file which was copied to your shared folder
Comment by User_810 on 2015-02-27:
Yes it worked finally. But I think there is some problem with my cirs.xml file. I tried these changes with shipwreck.xml and everything is working there. I will try to reinstall the file again. Thanks a lot for your replies.