ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Writing URDF for robot

asked 2022-02-16 04:05:31 -0500

1024son gravatar image

updated 2022-02-17 02:41:02 -0500

Hi all, am still new to ROS Noetic and the progress is not as smooth even while following ROS tutorial. Going through tutorial for urdf, the explanation on how to write urdf is understandable but it does not state where we can write our urdf.xacro file.

I have tried to edit the urdf file from urdf_tutorial but was unable to edit it.

I have also tried cloning github files to try launching the urdf.xacro file but is faced with issues as well. This is how i clone from github:

odroid@odroid:~$ cd ~/catkin_ws/src
odroid@odroid:~/catkin_ws/src$ git clone https://github.com/bandasaikrishna/Autonomous_Mobile_Robot.git
odroid@odroid:~/catkin_ws/src$ cd ~/catkin_ws
odroid@odroid:~/catkin_ws$ catkin_make
odroid@odroid:~/catkin_ws$ . ~/catkin_ws/devel/setup.bash

But launching the file from the one I clone from github returns:

odroid@odroid:~/catkin_ws/src/mobile_robot_autonomous_navigation$ roslaunch check_urdf.launch model:=urdf/mobile_robot.urdf
RLException: [check_urdf.launch] is not a launch file name
The traceback for the exception was written to the log file

Tried other solutions:

odroid@odroid:~$ source /home/odroid/catkin_ws/devel/setup.bash
odroid@odroid:~$ roslaunch mobile_robot_autonomous_navigation check_urdf.launch


RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: no such command [['/opt/ros/noetic/share/xacro/xacro.py', '/home/odroid/catkin_ws/src/mobile_robot_autonomous_navigation/urdf/mobile_robot.urdf.xacro']].

Param xml is <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)"/>
The traceback for the exception was written to the log file

So question in summary: 1- Where and how can I create and write urdf file? 2- What are the errors I have faced aboveand any soluiton?

I Thank you all in advance and really appreciate any help. Thank you, really.

ANSWER: The main issue is due to xacro.py being deprecated. Though my workspace does seem to have issue with sourcing the setup.bash from catkin_ws. Deleted and re-build (used catkin build instead of catkin_make) Catkin workspace and ran source /home/odroid/catkin_ws/devel/setup.bash.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-02-16 06:53:08 -0500

osilva gravatar image

I believe the repo in your link was developed for an older ROS distro.

xacro.py is deprecated.

In autonomous_nav.launch file found here replace the following:

<param name="robot_description" command="$(find xacro)/xacro.py $(arg model)"/>

to:

<param name="robot_description" command="$(find xacro)/xacro $(arg model)"/>
edit flag offensive delete link more

Comments

Alright. Thank you for replying. Thought it was a possibility but failed to find it while reading through the files(thinking I will find other distro name like kinetic etc).

Will report back when I am back in the lab and try it out.

Also, if possible, regarding sourcing the setup.bash file in "catkin_ws/devel" using:

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

is not working. Opening another terminal shows

home/catkin_ws/devel/setup.bash: No such file or directory

Thanks again.

1024son gravatar image 1024son  ( 2022-02-16 08:05:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-16 04:05:31 -0500

Seen: 190 times

Last updated: Feb 17 '22