joshnewans / articubot_one

301 stars 256 forks source link

Gazebo Crashing cmd 'gzserver -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'] #27

Open jainvrushabh5 opened 7 months ago

jainvrushabh5 commented 7 months ago

i’m working on a 2 wheel autonomous robot simulation with ROS2 and Gazebo. when never I launch this file gazebo sever crashing error Therefore im trying to setup ros2_control, but i got quiet some problems with it:

My setup: Ubuntu 22.04 Ros humble Gazebo 11.10.2

ros2 launch autonomous_bot launch_sim.launch.py 
[INFO] [launch]: All log files can be found below /home/rushabh/.ros/log/2024-04-10-10-20-53-087448-rushabh-Aspire-A515-57G-24269
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [24270]
[INFO] [gzserver-2]: process started with pid [24272]
[INFO] [gzclient-3]: process started with pid [24274]
[INFO] [spawn_entity.py-4]: process started with pid [24276]
[robot_state_publisher-1] [INFO] [1712724653.565116469] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-1] [INFO] [1712724653.565180780] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1712724653.565187384] [robot_state_publisher]: got segment caster_wheel
[robot_state_publisher-1] [INFO] [1712724653.565191307] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1712724653.565194777] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1712724653.565198448] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1712724653.565201901] [robot_state_publisher]: got segment right_wheel
[spawn_entity.py-4] [INFO] [1712724653.897650338] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1712724653.897867387] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] /opt/ros/humble/local/lib/python3.10/dist-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(
[spawn_entity.py-4] [INFO] [1712724653.899170320] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1712724653.901625135] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1712724653.901805336] [spawn_entity]: Waiting for service /spawn_entity
[spawn_entity.py-4] [INFO] [1712724654.406948601] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-4] [INFO] [1712724654.503504374] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [my_bot]
[gzserver-2] [WARN] [1712724654.505842505] [rcl]: Found remap rule '~/out:=scan'. This syntax is deprecated. Use '--ros-args --remap ~/out:=scan' instead.
[gzserver-2] [WARN] [1712724654.507346550] [rcl]: Found remap rule '~/out:=scan'. This syntax is deprecated. Use '--ros-args --remap ~/out:=scan' instead.
[gzserver-2] [INFO] [1712724654.620310544] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin
[gzserver-2] [INFO] [1712724654.621628001] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: /
[gzserver-2] [INFO] [1712724654.621737794] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control
[gzserver-2] [INFO] [1712724654.622666022] [gazebo_ros2_control]: connected to service!! robot_state_publisher
[gzserver-2] [INFO] [1712724654.623100631] [gazebo_ros2_control]: Received urdf from param server, parsing...
[gzserver-2] [INFO] [1712724654.623122673] [gazebo_ros2_control]: Loading parameter files /home/rushabh/ros2_ws/install/autonomous_bot/share/autonomous_bot/config/my_controller.yaml
[gzserver-2] [INFO] [1712724654.630469268] [gazebo_ros2_control]: Loading joint: left_wheel_joint
[gzserver-2] [INFO] [1712724654.630495525] [gazebo_ros2_control]:   State:
[gzserver-2] [INFO] [1712724654.630511420] [gazebo_ros2_control]:        velocity
[gzserver-2] [INFO] [1712724654.630516726] [gazebo_ros2_control]:        position
[gzserver-2] [INFO] [1712724654.630521067] [gazebo_ros2_control]:   Command:
[gzserver-2] [INFO] [1712724654.630537652] [gazebo_ros2_control]:        velocity
[gzserver-2] [INFO] [1712724654.630544866] [gazebo_ros2_control]: Loading joint: right_wheel_joint
[gzserver-2] [INFO] [1712724654.630549345] [gazebo_ros2_control]:   State:
[gzserver-2] [INFO] [1712724654.630553345] [gazebo_ros2_control]:        velocity
[gzserver-2] [INFO] [1712724654.630557432] [gazebo_ros2_control]:        position
[gzserver-2] [INFO] [1712724654.630561172] [gazebo_ros2_control]:   Command:
[gzserver-2] [INFO] [1712724654.630566595] [gazebo_ros2_control]:        velocity
[gzserver-2] [INFO] [1712724654.630588565] [resource_manager]: Initialize hardware 'GazeboSystem' 
[gzserver-2] [INFO] [1712724654.630656757] [resource_manager]: Successful initialization of hardware 'GazeboSystem'
[gzserver-2] [INFO] [1712724654.630698827] [resource_manager]: 'configure' hardware 'GazeboSystem' 
[gzserver-2] [INFO] [1712724654.630703790] [resource_manager]: Successful 'configure' of hardware 'GazeboSystem'
[gzserver-2] [INFO] [1712724654.630707221] [resource_manager]: 'activate' hardware 'GazeboSystem' 
[gzserver-2] [INFO] [1712724654.630710405] [resource_manager]: Successful 'activate' of hardware 'GazeboSystem'
[gzserver-2] [INFO] [1712724654.630769214] [gazebo_ros2_control]: Loading controller_manager
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 24276]
[ERROR] [gzserver-2]: process has died [pid 24272, exit code -11, cmd 'gzserver -slibgazebo_ros_init.so -slibgazebo_ros_factory.so -slibgazebo_ros_force_system.so'].
[ERROR] [gzclient-3]: process has died [pid 24274, exit code 255, cmd 'gzclient'].

robot.xarco

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

        <ros2_control name="GazeboSystem" type="system">
            <hardware>
                <plugin>gazebo_ros2_control/GazeboSystem</plugin>
            </hardware>
            <joint name="left_wheel_joint">
                <command_interface name="velocity">
                    <param name="min">-10</param>
                    <param name="max">10</param>
                </command_interface>
                <state_interface name="velocity"/>
                <state_interface name="position"/>
            </joint>
            <joint name="right_wheel_joint">
                <command_interface name="velocity">
                    <param name="min">-10</param>
                    <param name="max">10</param>
                </command_interface>
                <state_interface name="velocity"/>
                <state_interface name="position"/>
            </joint>
        </ros2_control>
         <gazebo>
        <plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
            <parameters>$(find autonomous_bot)/config/my_controller.yaml</parameters>
        </plugin>
    </gazebo>
</robot>
my_controller.yaml

controller_manager:
  ros__parameters:

    update_rate: 30.0
    use_sim_time: true

    diff_cont:
      type: diff_drive_controller/DiffDriveController

    joint_board:
      type: joint_state_broadcaster/JointStateBroadcaster

diff_cont:
  ros__parameters:

     publish_rate: 50.0

     base_frame_id: base link

     left_wheel_names: ['left_wheel_joint']
     right_wheel_names: ['right_wheel_joint']
     wheel_separation: 0.35
     wheel_radius: 0.05

     use_stamped_vel: false
0RBalaji commented 2 months ago

Can you show your package.xml file. I guess the issue must be because the gazebo isnt getting the urdf file correctly and crashing.