admin管理员组

文章数量:1399922

I am having some problem with a repository of mine, in which I aim to simulate a robot in Webots with an extern controller defined and employing ROS2-Webots packages and features. The link to my repo is the one below:

UPDATE:

The thing is I can't control my robot as expected. Right now, the robot is launched with the respective supervisor and controller, but the controller connects and disconnects continuously, leading to a situation where the robot is static and the controller process is aborted. When I launch it, I get this below:

$: ros2 launch ugv_pkg robot_launch.py 
[INFO] [launch]: All log files can be found below /home/caio_iriarte/.ros/log/2025-04-08-16-23-34-946577-pc-692368
[INFO] [launch]: Default logging verbosity is set to INFO
WARNING: No valid Webots directory specified in `ROS2_WEBOTS_HOME` and `WEBOTS_HOME`, fallback to default installation folder /usr/local/webots.
[INFO] [webots-1]: process started with pid [692369]
[INFO] [ros2_supervisor.py-2]: process started with pid [692371]
[INFO] [webots_controller_ugv_robot-3]: process started with pid [692373]
[webots_controller_ugv_robot-3] The specified robot (at /tmp/webots/caio_iriarte/1234/ipc/ugv_robot/extern) is not in the list of robots with <extern> controllers, retrying for another 50 seconds...
[ros2_supervisor.py-2] The specified robot (at /tmp/webots/caio_iriarte/1234/ipc/Ros2Supervisor/extern) is not in the list of robots with <extern> controllers, retrying for another 50 seconds...
[webots_controller_ugv_robot-3] terminate called after throwing an instance of 'std::runtime_error'
[webots_controller_ugv_robot-3]   what():  Error: The Python module with the WebotsNode class cannot be compiled.
[webots_controller_ugv_robot-3] [ros2run]: Aborted
[ERROR] [webots_controller_ugv_robot-3]: process has died [pid 692373, exit code 250, cmd '/home/caio_iriarte/ros2_robot/ugv_ws/install/webots_ros2_driver/share/webots_ros2_driver/scripts/webots-controller --robot-name=ugv_robot --protocol=ipc --port=1234 ros2 --ros-args -p robot_description:=/home/caio_iriarte/ros2_robot/ugv_ws/install/ugv_pkg/share/ugv_pkg/resource/ugv_robot.urdf'].
[INFO] [webots_controller_ugv_robot-3]: process started with pid [692477]
[webots_controller_ugv_robot-3] terminate called after throwing an instance of 'std::runtime_error'
[webots_controller_ugv_robot-3]   what():  Error: The Python module with the WebotsNode class cannot be compiled.
[webots_controller_ugv_robot-3] [ros2run]: Aborted

I suppose the main error is on the lines:

[INFO] [webots_controller_ugv_robot-3]: process started with pid [692477]
[webots_controller_ugv_robot-3] terminate called after throwing an instance of 'std::runtime_error'
[webots_controller_ugv_robot-3]   what():  Error: The Python module with the WebotsNode class cannot be compiled.
[webots_controller_ugv_robot-3] [ros2run]: Aborted

If anyone has got this error or knows how to handle it, please give me some advice. Thank you.

本文标签: pythonWebots simulation with ROS2ltexterngt controller (robot Ros2Supervisor)Stack Overflow