Can't load URDF to Gazebo
DyedBamboo opened this issue · 4 comments
ros2 launch learning_gazebo load_urdf_into_gazebo.launch.py
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [7829]
[INFO] [gzserver-2]: process started with pid [7831]
[INFO] [gzclient -3]: process started with pid [7833]
[INFO] [spawn_entity.py-4]: process started with pid [7838]
[robot_state_publisher-1] Link base_link had 4 children
[robot_state_publisher-1] Link back_caster_link had 0 children
[robot_state_publisher-1] Link front_caster_link had 0 children
[robot_state_publisher-1] Link left_wheel_link had 0 children
[robot_state_publisher-1] Link right_wheel_link had 0 children
[robot_state_publisher-1] [INFO] [1663576744.829343422] [robot_state_publisher]: got segment back_caster_link
[robot_state_publisher-1] [INFO] [1663576744.829418477] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1663576744.829430111] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1663576744.829437744] [robot_state_publisher]: got segment front_caster_link
[robot_state_publisher-1] [INFO] [1663576744.829444792] [robot_state_publisher]: got segment left_wheel_link
[robot_state_publisher-1] [INFO] [1663576744.829451605] [robot_state_publisher]: got segment right_wheel_link
[spawn_entity.py-4] [INFO] [1663576745.245802446] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1663576745.246239219] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] [INFO] [1663576745.247851605] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1663576745.250098949] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5
[spawn_entity.py-4] [INFO] [1663576745.250486615] [spawn_entity]: Waiting for service /spawn_entity
[gzserver-2] Service [/House 1/shininess] is not valid.
[gzserver-2] Service [/House 2/shininess] is not valid.
[gzserver-2] Service [/House 3/shininess] is not valid.
[spawn_entity.py-4] [INFO] [1663576746.004924633] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-4] [INFO] [1663576746.198636618] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [mbot]
[spawn_entity.py-4] /opt/ros/galactic/lib/python3.8/site-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[spawn_entity.py-4] warnings.warn(
[gzserver-2] [INFO] [1663576746.227915999] [differential_drive_controller]: Wheel pair 1 separation set to [0.380000m]
[gzserver-2] [INFO] [1663576746.228493786] [differential_drive_controller]: Wheel pair 1 diameter set to [0.120000m]
[gzserver-2] [INFO] [1663576746.229401485] [differential_drive_controller]: Subscribed to [/cmd_vel]
[gzserver-2] [INFO] [1663576746.230746020] [differential_drive_controller]: Advertise odometry on [/odom]
[gzserver-2] [INFO] [1663576746.232262138] [differential_drive_controller]: Publishing odom transforms between [odom] and [base_footprint]
[gzserver-2] [INFO] [1663576746.232297265] [differential_drive_controller]: Publishing wheel transforms between [base_footprint], [left_wheel_joint] and [right_wheel_joint]
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 7838]
[gzclient -3] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access::type = gazebo::rendering::Camera*]: Assertion `px != 0' failed.
[gzclient -3] Aborted
[ERROR] [gzclient -3]: process has died [pid 7833, exit code 134, cmd 'gzclient '].
ros2 launch learning_gazebo load_urdf_into_gazebo.launch.py
[INFO] [launch]: Default logging verbosity is set to INFO [INFO] [robot_state_publisher-1]: process started with pid [7829] [INFO] [gzserver-2]: process started with pid [7831] [INFO] [gzclient -3]: process started with pid [7833] [INFO] [spawn_entity.py-4]: process started with pid [7838] [robot_state_publisher-1] Link base_link had 4 children [robot_state_publisher-1] Link back_caster_link had 0 children [robot_state_publisher-1] Link front_caster_link had 0 children [robot_state_publisher-1] Link left_wheel_link had 0 children [robot_state_publisher-1] Link right_wheel_link had 0 children [robot_state_publisher-1] [INFO] [1663576744.829343422] [robot_state_publisher]: got segment back_caster_link [robot_state_publisher-1] [INFO] [1663576744.829418477] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-1] [INFO] [1663576744.829430111] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1663576744.829437744] [robot_state_publisher]: got segment front_caster_link [robot_state_publisher-1] [INFO] [1663576744.829444792] [robot_state_publisher]: got segment left_wheel_link [robot_state_publisher-1] [INFO] [1663576744.829451605] [robot_state_publisher]: got segment right_wheel_link [spawn_entity.py-4] [INFO] [1663576745.245802446] [spawn_entity]: Spawn Entity started [spawn_entity.py-4] [INFO] [1663576745.246239219] [spawn_entity]: Loading entity published on topic robot_description [spawn_entity.py-4] [INFO] [1663576745.247851605] [spawn_entity]: Waiting for entity xml on robot_description [spawn_entity.py-4] [INFO] [1663576745.250098949] [spawn_entity]: Waiting for service /spawn_entity, timeout = 5 [spawn_entity.py-4] [INFO] [1663576745.250486615] [spawn_entity]: Waiting for service /spawn_entity [gzserver-2] Service [/House 1/shininess] is not valid. [gzserver-2] Service [/House 2/shininess] is not valid. [gzserver-2] Service [/House 3/shininess] is not valid. [spawn_entity.py-4] [INFO] [1663576746.004924633] [spawn_entity]: Calling service /spawn_entity [spawn_entity.py-4] [INFO] [1663576746.198636618] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [mbot] [spawn_entity.py-4] /opt/ros/galactic/lib/python3.8/site-packages/rclpy/qos.py:307: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead. [spawn_entity.py-4] warnings.warn( [gzserver-2] [INFO] [1663576746.227915999] [differential_drive_controller]: Wheel pair 1 separation set to [0.380000m] [gzserver-2] [INFO] [1663576746.228493786] [differential_drive_controller]: Wheel pair 1 diameter set to [0.120000m] [gzserver-2] [INFO] [1663576746.229401485] [differential_drive_controller]: Subscribed to [/cmd_vel] [gzserver-2] [INFO] [1663576746.230746020] [differential_drive_controller]: Advertise odometry on [/odom] [gzserver-2] [INFO] [1663576746.232262138] [differential_drive_controller]: Publishing odom transforms between [odom] and [base_footprint] [gzserver-2] [INFO] [1663576746.232297265] [differential_drive_controller]: Publishing wheel transforms between [base_footprint], [left_wheel_joint] and [right_wheel_joint] [INFO] [spawn_entity.py-4]: process has finished cleanly [pid 7838] [gzclient -3] gzclient: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = gazebo::rendering::Camera; typename boost::detail::sp_member_access::type = gazebo::rendering::Camera*]: Assertion `px != 0' failed. [gzclient -3] Aborted [ERROR] [gzclient -3]: process has died [pid 7833, exit code 134, cmd 'gzclient '].
I can't see the robot imported to gazebo, did you meet the same problem? Have you find the solution please?
I just tried and it is ok, my environment is Ubuntu22.04+ROS Humble.
From your error message, it seems that some Gazebo models did not load successfully.
I think you should download the offline model(https://github.com/osrf/gazebo_models) to the local ~/.gazebo/models.
I just tried and it is ok, my environment is Ubuntu22.04+ROS Humble. From your error message, it seems that some Gazebo models did not load successfully. I think you should download the offline model(https://github.com/osrf/gazebo_models) to the local ~/.gazebo/models.
Thank you for your reply, I downloaded the gazebo_model and tried again.The problem remains. As you can see in the screen shotcut below, I
colcon build
successfully and input ros2 launch learning_gazebo load_urdf_into_gazebo.launch.py
in the terminal, no remarkable error appears, but the robot doesn't appear in gazebo.
The output is as following:
[INFO] [launch]: All log files can be found below /home/nio/.ros/log/2023-09-07-00-03-27-248749-MSCND2300DYT-283427
[INFO] [launch]: Default logging verbosity is set to INFO
processing xacro file: /home/nio/Documents/ROS2_learning_ws/install/learning_gazebo/share/learning_gazebo/urdf/mbot_gazebo.xacro
[INFO] [robot_state_publisher-1]: process started with pid [283439]
[INFO] [gzserver-2]: process started with pid [283441]
[INFO] [gzclient -3]: process started with pid [283443]
[INFO] [spawn_entity.py-4]: process started with pid [283446]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link base_link had 4 children
[robot_state_publisher-1] Link back_caster_link had 0 children
[robot_state_publisher-1] Link front_caster_link had 0 children
[robot_state_publisher-1] Link left_wheel_link had 0 children
[robot_state_publisher-1] Link right_wheel_link had 0 children
[robot_state_publisher-1] [INFO] [1694016207.580196988] [robot_state_publisher]: got segment back_caster_link
[robot_state_publisher-1] [INFO] [1694016207.580257146] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1694016207.580262218] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1694016207.580265393] [robot_state_publisher]: got segment front_caster_link
[robot_state_publisher-1] [INFO] [1694016207.580268457] [robot_state_publisher]: got segment left_wheel_link
[robot_state_publisher-1] [INFO] [1694016207.580271646] [robot_state_publisher]: got segment right_wheel_link
[ERROR] [gzserver-2]: process has died [pid 283441, exit code 255, cmd 'gzserver /home/nio/Documents/ROS2_learning_ws/install/learning_gazebo/share/learning_gazebo/worlds/neighborhood.world -s libgazebo_ros_init.so -s libgazebo_ros_factory.so -s libgazebo_ros_force_system.so '].
[spawn_entity.py-4] [INFO] [1694016207.832430509] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1694016207.832632962] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] [INFO] [1694016207.833391770] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1694016207.953363545] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1694016207.953562550] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] [INFO] [1694016207.955445244] [spawn_entity]: Calling service /spawn_entity
I just tried and it is ok, my environment is Ubuntu22.04+ROS Humble. From your error message, it seems that some Gazebo models did not load successfully. I think you should download the offline model(https://github.com/osrf/gazebo_models) to the local ~/.gazebo/models.
Thank you for your reply, I downloaded the gazebo_model and tried again.The problem remains. As you can see in the screen shotcut below, I
colcon build
successfully and inputros2 launch learning_gazebo load_urdf_into_gazebo.launch.py
in the terminal, no remarkable error appears, but the robot doesn't appear in gazebo. The output is as following:[INFO] [launch]: All log files can be found below /home/nio/.ros/log/2023-09-07-00-03-27-248749-MSCND2300DYT-283427 [INFO] [launch]: Default logging verbosity is set to INFO processing xacro file: /home/nio/Documents/ROS2_learning_ws/install/learning_gazebo/share/learning_gazebo/urdf/mbot_gazebo.xacro [INFO] [robot_state_publisher-1]: process started with pid [283439] [INFO] [gzserver-2]: process started with pid [283441] [INFO] [gzclient -3]: process started with pid [283443] [INFO] [spawn_entity.py-4]: process started with pid [283446] [robot_state_publisher-1] Parsing robot urdf xml string. [robot_state_publisher-1] Link base_link had 4 children [robot_state_publisher-1] Link back_caster_link had 0 children [robot_state_publisher-1] Link front_caster_link had 0 children [robot_state_publisher-1] Link left_wheel_link had 0 children [robot_state_publisher-1] Link right_wheel_link had 0 children [robot_state_publisher-1] [INFO] [1694016207.580196988] [robot_state_publisher]: got segment back_caster_link [robot_state_publisher-1] [INFO] [1694016207.580257146] [robot_state_publisher]: got segment base_footprint [robot_state_publisher-1] [INFO] [1694016207.580262218] [robot_state_publisher]: got segment base_link [robot_state_publisher-1] [INFO] [1694016207.580265393] [robot_state_publisher]: got segment front_caster_link [robot_state_publisher-1] [INFO] [1694016207.580268457] [robot_state_publisher]: got segment left_wheel_link [robot_state_publisher-1] [INFO] [1694016207.580271646] [robot_state_publisher]: got segment right_wheel_link [ERROR] [gzserver-2]: process has died [pid 283441, exit code 255, cmd 'gzserver /home/nio/Documents/ROS2_learning_ws/install/learning_gazebo/share/learning_gazebo/worlds/neighborhood.world -s libgazebo_ros_init.so -s libgazebo_ros_factory.so -s libgazebo_ros_force_system.so ']. [spawn_entity.py-4] [INFO] [1694016207.832430509] [spawn_entity]: Spawn Entity started [spawn_entity.py-4] [INFO] [1694016207.832632962] [spawn_entity]: Loading entity published on topic robot_description [spawn_entity.py-4] [INFO] [1694016207.833391770] [spawn_entity]: Waiting for entity xml on robot_description [spawn_entity.py-4] [INFO] [1694016207.953363545] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30 [spawn_entity.py-4] [INFO] [1694016207.953562550] [spawn_entity]: Waiting for service /spawn_entity [spawn_entity.py-4] [INFO] [1694016207.955445244] [spawn_entity]: Calling service /spawn_entity
It works now, maybe it's related to system updating.