0
$\begingroup$

Rosanswers logo

Hello. I want to make my robot arm with to use urdf on ROS2. However, I can't find lanch file like urdf_tutorial of ROS1 and use rviz from command line with urdf. I know that ROS2's launch file is writen by python but urdf_tutorial of ROS1 is written by XML file. In addition, I know ROS2'launch is beta vertion. How do I do ?


Originally posted by sumi on ROS Answers with karma: 11 on 2019-07-14

Post score: 1

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

The urdf tutorial of ros1 gives you a node that let's you view your urdf file, yes?

I was able to view my urdf file by running rviz2:

ros2 run rviz2 rviz2 

and then adding a RobotModel plugin, and setting the Description File variable to the path to my urdf file.

Then I saved off this .rviz file and launched rviz with it in the future with the command:

ros2 run rviz2 rviz2 -d *path/to/rviz_config_file*

Originally posted by johnconn with karma: 553 on 2019-07-15

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by rasmusan001 on 2020-02-04:
Just a note to the last command; it should be: ros2 run rviz2 rviz2 -d path/to/rviz_config_file ... not urdf_file.

Comment by johnconn on 2020-02-04:
thanks for the catch, I will edit.

$\endgroup$
0
$\begingroup$

Rosanswers logo

I know that this an old question, but I make a project with a launch to run a robot arm so I put here.

https://github.com/olmerg/lesson_urdf

This project implements a 3D planar robot in urdf. It also contain a launch with a robot_state_publisher and a joint_state_publisher_gui. It also configure the rviz with tf and robotModel plugin to view the robot.


Originally posted by remlog with karma: 66 on 2020-08-06

This answer was NOT ACCEPTED on the original site

Post score: 4

$\endgroup$
0
$\begingroup$

Rosanswers logo

The answer by @johnconn is valid, but it is missing joint_state_publisher_gui and joint_state_publisher which you may need.

Unfortunately, urdf_tutorial is not available as a Debian package, but you can install it from ros2 branch:
https://github.com/ros/urdf_tutorial/tree/ros2

# Source ROS2 environment
git clone -b ros2 https://github.com/ros/urdf_tutorial.git src/urdf_tutorial
colcon build --packages-select urdf_tutorial

# You may need to install `joint-state-publisher`
sudo apt install ros-foxy-joint-state-publisher-gui os-foxy-joint-state-publisher

And use it as:

ros2 launch urdf_tutorial display.launch.py model:=/path/to/your/urdf

You can also copy the launch file in your package:
https://github.com/ros/urdf_tutorial/blob/ros2/launch/display.launch.py


Originally posted by lukicdarkoo with karma: 486 on 2020-08-11

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by peterb on 2021-04-30:
I also needed to install ros-foxy-xacro package: sudo apt install ros-foxy-xacro

$\endgroup$

Your Answer

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