From sdk-wiki
Revision as of 15:14, 29 July 2014 by Sdkuser (talk | contribs) (Changed protection level for "HowTo - Main": Setting Permissions for (almost all) Pages - editable and moveable by all logged in users ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

General How To's, Tips, Tricks, etc.

URDF & more

Getting a Copy of the URDF Dynamically

Baxter generates the URDF dynamically on initialization, based on the attached arms. In some cases, users may want to get the current URDF off the robot. From a working Baxter RSDK environment, export the URDF from the /robot_description parameter on the ROS parameter server where it is stored, to a file of your choice (ex: baxter_urdf.xml):

   $ rosparam get -p /robot_description | tail -n +2 > baxter_urdf.xml

The -p outputs the parameter using pretty print. The output urdf is piped through the tail command first to remove a dummy first line - an artifact of the pretty print.

Tip: You can check that you now have a proper URDF by running:

   $ rosrun urdf_parser check_urdf baxter_urdf.xml

If this doesn't work, you can just remove the tail command and use a text editor to manually remove the first few lines before the actual xml (all the lines before <?xml version="1.0" ?>).

   $ rosparam get -p /robot_description > baxter_urdf.xml
   $ head baxter_urdf.xml
   |  
     <?xml version="1.0" ?>  
   ...  
   $ gedit baxter_urdf.xml &
   $ head baxter_urdf.xml
     <?xml version="1.0" ?>  
   ...