ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How can I put my urdf file in filesystem/opt/ros/hydro/share ??

asked 2014-03-22 09:08:59 -0600

Eman gravatar image

updated 2014-03-22 09:19:30 -0600

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.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-03-27 21:05:32 -0600

Eman gravatar image

updated 2014-03-27 21:45:23 -0600

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.

edit flag offensive delete link more

answered 2014-03-22 11:01:52 -0600

Maya gravatar image

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.

edit flag offensive delete link more


Thanks a lot for your help.

Eman gravatar image Eman  ( 2014-03-22 14:57:36 -0600 )edit

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.

Thomas D gravatar image Thomas D  ( 2014-03-22 17:00:31 -0600 )edit

@Thomas D Thanks a lot for your help

Eman gravatar image Eman  ( 2014-03-25 09:11:18 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-03-22 09:08:59 -0600

Seen: 791 times

Last updated: Mar 27 '14