PacktPublishing / ROS-Robotics-Projects-SecondEdition

ROS Robotics Projects, published by Packt
MIT License
187 stars 95 forks source link

Ch.3 "Segmentation Fault" when loading the model using roslaunch #1

Closed bishoyroufael closed 4 years ago

bishoyroufael commented 4 years ago

Testing the base of the industrial mobile manipulator using $ roslaunch robot_description base_gazebo_control_xacro.launch works but Gazebo crashes when trying to manipulate the model loaded in any manner. moving around the 3d mesh works normally, but when clicking on the model or trying to rotate it for example crashes gazebo. Consequently, the simulation using rqt_robot_steering doesn't work. Checking the terminal error gives segmentation fault.

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /gazebo_ros_control/pid_gains/front_left_wheel_joint/d: 0.0
 * /gazebo_ros_control/pid_gains/front_left_wheel_joint/i: 0.01
 * /gazebo_ros_control/pid_gains/front_left_wheel_joint/i_clamp: 0.0
 * /gazebo_ros_control/pid_gains/front_left_wheel_joint/p: 20.0
 * /gazebo_ros_control/pid_gains/front_right_wheel_joint/d: 0.0
 * /gazebo_ros_control/pid_gains/front_right_wheel_joint/i: 0.01
 * /gazebo_ros_control/pid_gains/front_right_wheel_joint/i_clamp: 0.0
 * /gazebo_ros_control/pid_gains/front_right_wheel_joint/p: 20.0
 * /gazebo_ros_control/pid_gains/rear_left_wheel_joint/d: 0.0
 * /gazebo_ros_control/pid_gains/rear_left_wheel_joint/i: 0.01
 * /gazebo_ros_control/pid_gains/rear_left_wheel_joint/i_clamp: 0.0
 * /gazebo_ros_control/pid_gains/rear_left_wheel_joint/p: 20.0
 * /gazebo_ros_control/pid_gains/rear_right_wheel_joint/d: 0.0
 * /gazebo_ros_control/pid_gains/rear_right_wheel_joint/i: 0.01
 * /gazebo_ros_control/pid_gains/rear_right_wheel_joint/i_clamp: 0.0
 * /gazebo_ros_control/pid_gains/rear_right_wheel_joint/p: 20.0
 * /robot_base_joint_publisher/publish_rate: 50
 * /robot_base_joint_publisher/type: joint_state_contr...
 * /robot_base_velocity_controller/angular/z/has_acceleration_limits: True
 * /robot_base_velocity_controller/angular/z/has_velocity_limits: True
 * /robot_base_velocity_controller/angular/z/max_acceleration: 6.0
 * /robot_base_velocity_controller/angular/z/max_velocity: 3.0
 * /robot_base_velocity_controller/base_frame_id: base_link
 * /robot_base_velocity_controller/cmd_vel_timeout: 0.5
 * /robot_base_velocity_controller/enable_odom_tf: True
 * /robot_base_velocity_controller/estimate_velocity_from_position: False
 * /robot_base_velocity_controller/left_wheel: ['front_left_whee...
 * /robot_base_velocity_controller/linear/x/has_acceleration_limits: True
 * /robot_base_velocity_controller/linear/x/has_velocity_limits: True
 * /robot_base_velocity_controller/linear/x/max_acceleration: 3.0
 * /robot_base_velocity_controller/linear/x/max_velocity: 2.0
 * /robot_base_velocity_controller/odom_frame_id: odom
 * /robot_base_velocity_controller/pose_covariance_diagonal: [0.001, 0.001, 0....
 * /robot_base_velocity_controller/publish_rate: 50
 * /robot_base_velocity_controller/right_wheel: ['front_right_whe...
 * /robot_base_velocity_controller/twist_covariance_diagonal: [0.001, 0.001, 0....
 * /robot_base_velocity_controller/type: diff_drive_contro...
 * /robot_base_velocity_controller/wheel_radius: 0.0625
 * /robot_base_velocity_controller/wheel_radius_multiplier: 1.0
 * /robot_base_velocity_controller/wheel_separation: 0.445208
 * /robot_base_velocity_controller/wheel_separation_multiplier: 1.0
 * /robot_description: <?xml version="1....
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /use_sim_time: True

NODES
  /
    base_controller_spawner (controller_manager/spawner)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    spawn_urdf (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [29341]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 6824628a-510d-11ea-bd4a-f4d10862b5f1
process[rosout-1]: started with pid [29352]
started core service [/rosout]
process[gazebo-2]: started with pid [29359]
process[gazebo_gui-3]: started with pid [29364]
process[spawn_urdf-4]: started with pid [29369]
process[base_controller_spawner-5]: started with pid [29370]
[Err] [ClientConfig.cc:270] Parser error [4]
[Err] [ClientConfig.cc:270] Parser error [4]
[ INFO] [1581892863.081364545]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1581892863.084118685]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1581892863.162505634]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1581892863.165607916]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1581892864.115396633, 0.023000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1581892864.335945298, 0.036000000]: Physics dynamic reconfigure ready.
[ INFO] [1581892864.383361210, 0.036000000]: Loading gazebo_ros_control plugin
[ INFO] [1581892864.383658852, 0.036000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1581892864.385370919, 0.036000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[spawn_urdf-4] process has finished cleanly
log file: /home/bishoy/.ros/log/6824628a-510d-11ea-bd4a-f4d10862b5f1/spawn_urdf-4*.log
[ INFO] [1581892864.682795021, 0.036000000]: Loaded gazebo_ros_control.
[ INFO] [1581892864.728662771, 0.036000000]: Starting plugin DiffDrive(ns = //)
[ INFO] [1581892864.728990421, 0.036000000]: DiffDrive(ns = //): <rosDebugLevel> = Debug
[ INFO] [1581892864.730310783, 0.036000000]: DiffDrive(ns = //): <tf_prefix> = 
[DEBUG] [1581892864.730631867, 0.036000000]: DiffDrive(ns = //): <commandTopic> = cmd_vel
[DEBUG] [1581892864.730825197, 0.036000000]: DiffDrive(ns = //): <odometryTopic> = odom
[DEBUG] [1581892864.730961985, 0.036000000]: DiffDrive(ns = //): <odometryFrame> = map
[DEBUG] [1581892864.731081691, 0.036000000]: DiffDrive(ns = //): <robotBaseFrame> = base_link
[DEBUG] [1581892864.731255951, 0.036000000]: DiffDrive(ns = //): <publishWheelTF> = false
[ WARN] [1581892864.731329694, 0.036000000]: DiffDrive(ns = //): missing <publishOdomTF> default is true
[DEBUG] [1581892864.731395306, 0.036000000]: DiffDrive(ns = //): <publishWheelJointState> = true
[DEBUG] [1581892864.731575156, 0.036000000]: DiffDrive(ns = //): <wheelSeparation> = 0.5
[DEBUG] [1581892864.731687080, 0.036000000]: DiffDrive(ns = //): <wheelDiameter> = 0.20000000000000001
[DEBUG] [1581892864.731782431, 0.036000000]: DiffDrive(ns = //): <wheelAcceleration> = 2.7999999999999998
[DEBUG] [1581892864.731865830, 0.036000000]: DiffDrive(ns = //): <wheelTorque> = 10
[DEBUG] [1581892864.731930999, 0.036000000]: DiffDrive(ns = //): <updateRate> = 1000
[DEBUG] [1581892864.732129799, 0.036000000]: DiffDrive(ns = //): <odometrySource> = world := 1
[DEBUG] [1581892864.732278490, 0.036000000]: DiffDrive(ns = //): <leftJoint> = front_left_wheel_joint, rear_left_wheel_joint
[ INFO] [1581892864.893712281, 0.134000000]: Controller state will be published at 50Hz.
[ INFO] [1581892864.896367213, 0.137000000]: Wheel separation will be multiplied by 1.
[ INFO] [1581892864.897928795, 0.138000000]: Left wheel radius will be multiplied by 1.
[ INFO] [1581892864.897995029, 0.138000000]: Right wheel radius will be multiplied by 1.
[ INFO] [1581892864.898987667, 0.139000000]: Velocity rolling window size of 10.
[ INFO] [1581892864.900825752, 0.141000000]: Velocity commands will be considered old if they are older than 0.5s.
[ INFO] [1581892864.901938850, 0.142000000]: Allow mutiple cmd_vel publishers is enabled
[ INFO] [1581892864.903952770, 0.144000000]: Base frame_id set to base_link
[ INFO] [1581892864.905460455, 0.145000000]: Odometry frame_id set to odom
[ INFO] [1581892864.907092005, 0.147000000]: Publishing to tf is enabled
[ INFO] [1581892864.932342709, 0.166000000]: Odometry params : wheel separation 0.445208, left wheel radius 0.0625, right wheel radius 0.0625
[ INFO] [1581892864.937198985, 0.171000000]: Adding left wheel with joint name: front_left_wheel_joint and right wheel with joint name: front_right_wheel_joint
[ INFO] [1581892864.937407329, 0.171000000]: Adding left wheel with joint name: rear_left_wheel_joint and right wheel with joint name: rear_right_wheel_joint
[ WARN] [1581892864.956230957, 0.189000000]: updateConfig() called on a dynamic_reconfigure::Server that provides its own mutex. This can lead to deadlocks if updateConfig() is called during an update. Providing a mutex to the constructor is highly recommended in this case. Please forward this message to the node author.
[ INFO] [1581892864.963438628, 0.196000000]: Dynamic Reconfigure:
DynamicParams:
    Odometry parameters:
        left wheel radius multiplier: 1
        right wheel radius multiplier: 1
        wheel separation multiplier: 1
    Publication parameters:
        Publish executed velocity command: disabled
        Publication rate: 50
        Publish frame odom on tf: enabled
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/controller_manager/spawner", line 207, in <module>
    if __name__ == '__main__': main()
  File "/opt/ros/melodic/lib/controller_manager/spawner", line 199, in main
    Segmentation fault (core dumped)
resp = switch_controller(loaded, [], 2)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 439, in __call__
    return self.call(*args, **kwds)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 529, in call
    raise ServiceException("transport error completing service call: %s"%(str(e)))
rospy.service.ServiceException: transport error completing service call: unable to receive data from sender, check sender's logs for details
[WARN] [1581892865.213510, 0.210000]: Controller Spawner error while taking down controllers: unable to connect to service: [Errno 111] Connection refused
[gazebo-2] process has died [pid 29359, exit code 139, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/bishoy/.ros/log/6824628a-510d-11ea-bd4a-f4d10862b5f1/gazebo-2.log].
log file: /home/bishoy/.ros/log/6824628a-510d-11ea-bd4a-f4d10862b5f1/gazebo-2*.log
[base_controller_spawner-5] process has died [pid 29370, exit code 1, cmd /opt/ros/melodic/lib/controller_manager/spawner robot_base_joint_publisher robot_base_velocity_controller __name:=base_controller_spawner __log:=/home/bishoy/.ros/log/6824628a-510d-11ea-bd4a-f4d10862b5f1/base_controller_spawner-5.log].
log file: /home/bishoy/.ros/log/6824628a-510d-11ea-bd4a-f4d10862b5f1/base_controller_spawner-5*.log
ram651991 commented 4 years ago

Looks like your controllers are messed up. Could you check re-installing ros controllers using sudo apt-get install ros-melodic-controller-manager (this alone should do the trick) ; however suggest to install these as well and check : sudo apt-get install ros-melodic-ros-controllers and sudo apt-get install ros-melodic-ros-control