Rosanswers logo

In Ros wiki tutorials, There are a lot of packages that any one can install in his PC using commands . For example the urdf_tutorial package. I used the command rosdep install urdf_tutorial to install it on my PC. It has been installed in filesystem/opt/ros/hydro/share with its URDF and launch files & when I used commands in terminal to view the R2D2 robot, it worked successfully.But,when I created my own urdf file, I couldn't put it in filesystem/opt/ros/hydro/share in the same concept as urdf_tutorial package to be able to view it in Rviz. I also couldn't modify its urdf files to be suitable for my own robot. So, my question is: How can I put my urdf file in filesystem/opt/ros/hydro/share ?? or how can I modify a urdf file that is found in filesystem/opt/ros/hydro/share ??

  • Is there any commands that should I use in terminal to do that ??

  • Are there any prerequisites that should I install on my pc ??

    • my distribution is Hydro.
    • I use ubuntu 12.10.


Originally posted by Eman on ROS Answers with karma: 164 on 2014-03-22

Post score: 1


2 Answers 2


Rosanswers logo

To mofidy a file in in opt/... you need to be a super user. Meaning, you have to use sudo gedit in the terminal to edit the file (that if you are using gedit).

Now I would personally advise you NOT TO DO THIS! You don't want to change those important files. To view the urdf of R2D2 if I recall correctly you had to give the name of the urdf as argument at some point. You should save your URDF anywhere on your computer and give the absolute path to your URDF as argument. Like /home/yourname/robot.urdf

You could as well just copy the urdf tutorial files somewhere else in your catkin workspace and use those new files to load your urdf.

Go have a look to the super user authorization rules and stuff under linux environnement you will understand why you can't modify those files in stack.

Originally posted by Maya with karma: 1172 on 2014-03-22

This answer was NOT ACCEPTED on the original site

Post score: 2

Original comments

Comment by Eman on 2014-03-22:
Thanks a lot for your help.

Comment by Thomas D on 2014-03-22:
Creating a package with your URDF files and then putting that package in your workspace will let you use $(find my_urdf_package)/urdf/main.xacro.urdf (or whatever you have) to launch your robot model and is by far the best choice.

Comment by Eman on 2014-03-25:
@Thomas D Thanks a lot for your help


Rosanswers logo

There is a command to transfer any file from place to another. This command is sudo cp.

  • The command should be like that:

sudo cp /path of the file where your file exists /path of file where you want to transfer your file

  • For example:

sudo cp /home/eman/Downloads/my_robot.urdf /opt/ros/hydro/share/urdf_tutorial

where /home/eman/Downloads/my_robot.urdf is the path where the urdf_file ( my_robot.urdf ) exists and /opt/ros/hydro/share/urdf_tutorial is the path where I want to transfer this file.

When I used this command,it had worked successfully & my urdf_file has been transferred to the urdf_tutorial package.

Originally posted by Eman with karma: 164 on 2014-03-27

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.