RobCo : Comment générer l'URDF pour votre robot ?

Après avoir suivi nos instructions comment installer le binding ROS2 de RobCo, effectuez ces étapes pour exporter un URDF.

Premier shell : Exécuter view_model.launch.py

Vous n’avez pas nécessairement besoin d’une interface graphique pour celui-ci, un accès SSH suffit.

run_view_model.sh
cd robco_ws
source install/local_setup.sh
ros2 launch robco_description view_model.launch.py

Laissez ce shell en cours d’exécution jusqu’à ce que l’URDF soit exporté.

Exemple de sortie

view_model_output.txt
$ ros2 launch robco_description view_model.launch.py
[INFO] [launch]: All log files can be found below /home/uli/.ros/log/2026-04-27-21-04-19-855503-mypc03-927172
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [927193]
[INFO] [joint_state_publisher_gui-2]: process started with pid [927194]
[INFO] [rviz2-3]: process started with pid [927195]
[robot_state_publisher-1] [WARN] [1777316660.046560018] [kdl_parser]: The root link joint0 has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[robot_state_publisher-1] [INFO] [1777316660.046728648] [robot_state_publisher]: Robot initialized
[rviz2-3] qt.qpa.xcb: could not connect to display
[rviz2-3] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
[rviz2-3] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[rviz2-3]
[rviz2-3] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
[rviz2-3]
[joint_state_publisher_gui-2] qt.qpa.xcb: could not connect to display
[joint_state_publisher_gui-2] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
[joint_state_publisher_gui-2] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[joint_state_publisher_gui-2]
[joint_state_publisher_gui-2] Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
[joint_state_publisher_gui-2]
[ERROR] [rviz2-3]: process has died [pid 927195, exit code -6, cmd '/opt/ros/jazzy/lib/rviz2/rviz2 --display-config /home/uli/robco_ws/install/robco_description/share/robco_description/rviz/view_model.rviz --ros-args -r __node:=rviz2'].
[ERROR] [joint_state_publisher_gui-2]: process has died [pid 927194, exit code -6, cmd '/opt/ros/jazzy/lib/joint_state_publisher_gui/joint_state_publisher_gui --ros-args -r __node:=joint_state_publisher_gui']

Second shell : Exporter l’URDF

export_urdf.sh
cd robco_ws
source install/setup.sh
ros2 param get /robot_state_publisher robot_description > MyRobCo.urdf

Cette commande n’a aucune sortie, et exportera l’URDF complet vers un fichier nommé MyRobCo.urdf dans votre répertoire courant. Vous pouvez changer le nom du fichier selon vos besoins. En interne, elle générera l’URDF à partir des fichiers xacro.


Check out similar posts by category: Robotics