ros-controls / ros_control

Generic and simple controls framework for ROS
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
469 stars 307 forks source link

Segmentation fault by controller spawner on loading(or searching) my custom written controller #476

Closed rishabh900 closed 3 years ago

rishabh900 commented 3 years ago

I have made customised transmission and hardware interface for my robot urdf model as well as the gazebo plugin is also little bit modified version of the gazebo_ros_control plugin. According to the logs my plugin is loaded successfully but upon launching the controller manager node, the controller spawner is not able to find(this is what I think) my custom controller. I have followed all the instructions for writing the custom controller(rospack is able to reach it) so probably it is dynamically loading correctly.

The following is the log displayed on my terminal:-

[INFO][/opt/ros/melodic/lib/controller_manager/spawner]>>[121] : Controller Spawner: Waiting for service controller_manager/load_controller [ INFO][/tmp/binarydeb/ros-melodic-gazebo-ros-2.8.7/src/gazebo_ros_api_plugin.cpp]>>[168] : Finished loading Gazebo ROS API Plugin. [ INFO][/tmp/binarydeb/ros-melodic-roscpp-1.14.9/src/libros/service.cpp]>>[80] : waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... [ INFO][/tmp/binarydeb/ros-melodic-gazebo-ros-2.8.7/src/gazebo_ros_api_plugin.cpp]>>[168] : Finished loading Gazebo ROS API Plugin. [ INFO][/tmp/binarydeb/ros-melodic-roscpp-1.14.9/src/libros/service.cpp]>>[80] : waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting... [INFO][/opt/ros/melodic/lib/gazebo_ros/spawn_model]>>[131] : Loading model XML from ros parameter robot_description [INFO][/opt/ros/melodic/lib/python2.7/dist-packages/gazebo_ros/gazebo_interface.py]>>[27] : Waiting for service /gazebo/spawn_urdf_model [ INFO][/tmp/binarydeb/ros-melodic-roscpp-1.14.9/src/libros/service.cpp]>>[123] : waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO][/tmp/binarydeb/ros-melodic-gazebo-ros-2.8.7/src/gazebo_ros_api_plugin.cpp]>>[2334] : Physics dynamic reconfigure ready. [INFO][/opt/ros/melodic/lib/python2.7/dist-packages/gazebo_ros/gazebo_interface.py]>>[31] : Calling service /gazebo/spawn_urdf_model [INFO][/opt/ros/melodic/lib/python2.7/dist-packages/gazebo_ros/gazebo_interface.py]>>[33] : Spawn status: SpawnModel: Successfully spawned entity [INFO][/opt/ros/melodic/lib/gazebo_ros/spawn_model]>>[207] : Unpausing physics [ INFO][/home/curse/Ros_Melodic/src/screw_gzplugin/src/screw_plugin.cpp]>>[27] : Loading screw_gzplugin plugin [ INFO][/home/curse/Ros_Melodic/src/screw_gzplugin/src/screw_plugin.cpp]>>[127] : Starting screw_gzplugin plugin in namespace: / [ INFO][/home/curse/Ros_Melodic/src/screw_gzplugin/src/screw_plugin.cpp]>>[253] : screw_gzplugin plugin is waiting for model URDF in parameter [robot_description] on the ROS param server. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[84] : Creating ClassLoader, base = controller_interface::ControllerBase, address = 0x560d1d7b7e00 [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[253] : Entering determineAvailableClasses()... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/diff_drive_controller/diff_drive_controller_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = diff_drive_controller/DiffDriveController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/position_controllers/position_controllers_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = position_controllers/JointPositionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = position_controllers/JointGroupPositionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/ackermann_steering_controller/ackermann_steering_controller_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = ackermann_steering_controller/AckermannSteeringController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/joint_trajectory_controller/ros_control_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = position_controllers/JointTrajectoryController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = velocity_controllers/JointTrajectoryController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/JointTrajectoryController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = pos_vel_controllers/JointTrajectoryController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = pos_vel_acc_controllers/JointTrajectoryController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/force_torque_sensor_controller/force_torque_sensor_plugin.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = force_torque_sensor_controller/ForceTorqueSensorController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/velocity_controllers/velocity_controllers_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = velocity_controllers/JointVelocityController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = velocity_controllers/JointPositionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = velocity_controllers/JointGroupVelocityController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/joint_state_controller/joint_state_plugin.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = joint_state_controller/JointStateController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/effort_controllers/effort_controllers_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/JointPositionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/JointVelocityController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/JointEffortController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/JointGroupEffortController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/JointGroupPositionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/gripper_action_controller/ros_control_plugins.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = position_controllers/GripperActionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = effort_controllers/GripperActionController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[639] : Processing xml file /opt/ros/melodic/share/imu_sensor_controller/imu_sensor_plugin.xml... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[703] : XML file specifies lookup name (i.e. magic name) = imu_sensor_controller/ImuSensorController. [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[269] : Exiting determineAvailableClasses()... [DEBUG][/opt/ros/melodic/include/pluginlib/./class_loader_imp.hpp]>>[95] : Finished constructring ClassLoader, base = controller_interface::ControllerBase, address = 0x560d1d7b7e00 [ INFO][/home/curse/Ros_Melodic/src/screw_gzplugin/src/screw_plugin.cpp]>>[173] : Loaded screw_gzplugin. [INFO][/opt/ros/melodic/lib/controller_manager/spawner]>>[126] : Controller Spawner: Waiting for service controller_manager/switch_controller [INFO][/opt/ros/melodic/lib/controller_manager/spawner]>>[134] : Controller Spawner: Waiting for service controller_manager/unload_controller [INFO][/opt/ros/melodic/lib/controller_manager/spawner]>>[189] : Loading controller: joint1_position_controller [spawn_urdf-4] process has finished cleanly log file: /home/curse/.ros/log/db310e6a-f7d7-11ea-99fb-976e2af69960/spawn_urdf-4.log Traceback (most recent call last): File "/opt/ros/melodic/lib/controller_manager/spawner", line 212, in if name == 'main': main() File "/opt/ros/melodic/lib/controller_manager/spawner", line 190, in main resp = load_controller(name) File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 442, in call return self.call(args, *kwds) File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 512, in call raise ServiceException("unable to connect to service: %s"%e) rospy.service.ServiceException: unable to connect to service: [Errno 104] Connection reset by peer Segmentation fault (core dumped) [INFO][/opt/ros/melodic/lib/controller_manager/spawner]>>[55] : Shutting down spawner. Stopping and unloading controllers... [INFO][/opt/ros/melodic/lib/controller_manager/spawner]>>[64] : Stopping all controllers... [WARN][/opt/ros/melodic/lib/controller_manager/spawner]>>[72] : Controller Spawner error while taking down controllers: unable to connect to service: [Errno 111] Connection refused [gazebo-2] process has died [pid 22295, exit code 139, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode worlds/empty.world name:=gazebo log:=/home/curse/.ros/log/db310e6a-f7d7-11ea-99fb-976e2af69960/gazebo-2.log]. log file: /home/curse/.ros/log/db310e6a-f7d7-11ea-99fb-976e2af69960/gazebo-2.log [Err] [REST.cc:205] Error in REST request libcurl: (51) SSL: no alternative certificate subject name matches target host name 'api.ignitionfuel.org' [controller_spawner-5] process has died [pid 22307, exit code 1, cmd /opt/ros/melodic/lib/controller_manager/spawner joint1_position_controller __name:=controller_spawner __log:=/home/curse/.ros/log/db310e6a-f7d7-11ea-99fb-976e2af69960/controller_spawner-5.log]. log file: /home/curse/.ros/log/db310e6a-f7d7-11ea-99fb-976e2af69960/controller_spawner-5*.log

I have not mentioned any namespace in my launch file, controller configuraton file and urdf file, so hopefully it is not a scoping error. Kindly help me understand this issue.

jsaltducaju commented 1 year ago

Hi!

I am having the same issue. How did you solve it?