Problem in creating .urdf files
Hello everyone. I want to create .urdf file from the file lwa.urdf.xacro. My OS is Ubuntu 14.04 and ROS distribution is indigo.
In the folder: opt/ros/indigo/stacks/schunk_description/urdf/lwa
There are 3 files:
- lwa.gazebo.xacro
- lwa.transmission.xacro
- lwa.urdf.xacro
In terminal, I direct to this directory and command:
ros@ros:~$ rosrun xacro xacro.py lwa.urdf.xacro > lwa.urdf
ros@ros:/opt/ros/indigo/stacks/schunk_modular_robotics/schunk_description/urdf/lwa$ rosrun xacro xacro.py lwa.urdf.xacro > lwa.urdf
bash: lwa.urdf: Permission denied
I know that my question might be somehow silly. I am sorry but it probably refers to my lack of proper knowledge, esp. with Linux. I just guess it must have something to do with permissions. I would appreciate if someone help me or share his/her experience in creating .urdf files with me.
Thanks a lot,
Damon
P.S. Why do I need .urdf file? Gazebo works with .xacro files smoothly and I already can load the robot in gazebo or send the commands to it. The point is that I want to use Moveit! Moveit has an "assistant" which helps you make Moveit recognize your robot. When I load xacro file of PR2 robot in Moveit, the assistant works fine and seemingly creates a .urdf file for itself. But this doesn't work when I load xacro file of schunk. And the reason is that Moveit tries to build .urdf file and fails. This makes me feel if I want moveit work, I should first be able to create .urdf files.
Edit:
First of all, thanks for your time and attention. :) xacro has been introduced to replace urdf. Basically we should be able to create urdf from xacro. My schunk package (schunk_description) is in: opt/ros/indigo/stacks/schunk_modular_robotics
I thought if the problem is permissions, what if I try to make a copy of the package somewhere else and try again. So I copied the package to /Documents. And:
ros@ros:~$ cd Documents
ros@ros:~/Documents$ cd schunk_modular_robotics/schunk_description/urdf/lwa
ros@ros:~/Documents/schunk_modular_robotics/schunk_description/urdf/lwa$ rosrun xacro xacro.py lwa.urdf.xacro > lwa.urdf
This created an empty .urdf file. Here is the contents:
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from lwa.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
</robot>
Moveit used to use .urdf file. But recently, they say the user can also browse to .xacro file as well. I think this is exactly what Moveit tries to do automatically, and probably the urdf file is also created. But since it is empty, Moveit fails. Here is when I try to browse the lwa.urdf.xacro file in Moveit:
An error message shown by setup assistant in a small window: "URDF/COLLADA file is not a valid robot model."
And when I look at the terminal, I see this:
[rospack] Error: no package given
[librospack ...
It is a permission error: you (as a regular user) cannot write in that directory. But (and this will sound a bit pedantic) a better approach would be to figure out what is wrong with the schunk xacros. The Setup Assistant should be able to load it just fine.
Could you update (edit) your question with what "it doesn't work" actually means? If you get any error output on the console, please copy/paste that into your question as well.
Again a bit pedantic, but: please don't use answers to post updates. Either use a comment, or edit your original post. I've moved the content of your answer as an edit to your original question.
Ow thanks. Sorry, today is my first day in this forum! Need to learn how to post things and format them properly.
HaHa! I was wondering how my writing turned to be so nicely formatted! Automatically?! So you had done it! :D
No problem. Formatting isn't too hard: just use the buttons on the formatting bar above the text area. For console copy/paste, use the preformatted text button (the one with
101010
on it).