RobCo: Как сгенерировать URDF для вашего робота?
После выполнения наших инструкций по установке привязки RobCo к ROS2, выполните следующие шаги для экспорта URDF.
Первый терминал: Запуск view_model.launch.py
Для этого не обязательно нужен графический интерфейс, подойдёт доступ по SSH.
run_view_model.sh
cd robco_ws
source install/local_setup.sh
ros2 launch robco_description view_model.launch.pyОставьте этот терминал запущенным до тех пор, пока URDF не будет экспортирован.
Пример вывода
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']Второй терминал: Экспорт URDF
export_urdf.sh
cd robco_ws
source install/setup.sh
ros2 param get /robot_state_publisher robot_description > MyRobCo.urdfЭта команда не выводит ничего и экспортирует полный URDF в файл с именем MyRobCo.urdf в текущем каталоге. Вы можете изменить имя файла по необходимости. Внутренне она генерирует URDF из файлов xacro.
Check out similar posts by category:
Robotics
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow