frankaemika / franka_ros2

ROS 2 integration for Franka research robots
https://frankaemika.github.io/docs/franka_ros2.html
Apache License 2.0
106 stars 68 forks source link

Moveit crashes with franka_ros2 and libfranka (0.10.0) #25

Closed laibazahid26 closed 1 year ago

laibazahid26 commented 1 year ago

Hello,

I am working with franka research 3. I tried building franka_ros2 repo with libfranka tag (0.10.0). I followed the official instructions for building franka_ros2 and for building and installing libfranka tag 0.10.0 I followed the instructions here

When I typed the command below with my robot's IP:

ros2 launch franka_moveit_config moveit.launch.py robot_ip:=<fci-ip>

I had some errors including errors related to stack smashing:

ros2 launch franka_moveit_config moveit.launch.py robot_ip:=192.168.88.250
[INFO] [launch]: All log files can be found below /home/zal2mu/.ros/log/2023-06-20-14-24-58-695950-MCWWCN8157-78698
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [rviz2-1]: process started with pid [78706]
[INFO] [robot_state_publisher-2]: process started with pid [78708]
[INFO] [move_group-3]: process started with pid [78710]
[INFO] [ros2_control_node-4]: process started with pid [78712]
[INFO] [joint_state_publisher-5]: process started with pid [78714]
[INFO] [franka_gripper_node-6]: process started with pid [78716]
[INFO] [ros2 run controller_manager spawner.py panda_arm_controller-7]: process started with pid [78718]
[INFO] [ros2 run controller_manager spawner.py joint_state_broadcaster-8]: process started with pid [78721]
[franka_gripper_node-6] [INFO] [1687263899.320906254] [panda_gripper]: Trying to establish a connection with the gripper
[franka_gripper_node-6] [INFO] [1687263899.321560369] [panda_gripper]: Connected to gripper
[ros2_control_node-4] [INFO] [1687263899.325027572] [FrankaHardwareInterface]: Connecting to robot at "192.168.88.250" ...
[robot_state_publisher-2] Parsing robot urdf xml string.
[robot_state_publisher-2] Link panda_link1 had 1 children
[robot_state_publisher-2] Link panda_link2 had 1 children
[robot_state_publisher-2] Link panda_link3 had 1 children
[robot_state_publisher-2] Link panda_link4 had 1 children
[robot_state_publisher-2] Link panda_link5 had 1 children
[robot_state_publisher-2] Link panda_link6 had 1 children
[robot_state_publisher-2] Link panda_link7 had 1 children
[robot_state_publisher-2] Link panda_link8 had 1 children
[robot_state_publisher-2] Link panda_hand had 3 children
[robot_state_publisher-2] Link panda_leftfinger had 0 children
[robot_state_publisher-2] Link panda_rightfinger had 0 children
[robot_state_publisher-2] Link panda_hand_tcp had 0 children
[robot_state_publisher-2] [INFO] [1687263899.326142223] [robot_state_publisher]: got segment panda_hand
[robot_state_publisher-2] [INFO] [1687263899.326191971] [robot_state_publisher]: got segment panda_hand_tcp
[robot_state_publisher-2] [INFO] [1687263899.326197962] [robot_state_publisher]: got segment panda_leftfinger
[robot_state_publisher-2] [INFO] [1687263899.326202258] [robot_state_publisher]: got segment panda_link0
[robot_state_publisher-2] [INFO] [1687263899.326206177] [robot_state_publisher]: got segment panda_link1
[robot_state_publisher-2] [INFO] [1687263899.326210044] [robot_state_publisher]: got segment panda_link2
[robot_state_publisher-2] [INFO] [1687263899.326213761] [robot_state_publisher]: got segment panda_link3
[robot_state_publisher-2] [INFO] [1687263899.326217476] [robot_state_publisher]: got segment panda_link4
[robot_state_publisher-2] [INFO] [1687263899.326221496] [robot_state_publisher]: got segment panda_link5
[robot_state_publisher-2] [INFO] [1687263899.326225256] [robot_state_publisher]: got segment panda_link6
[robot_state_publisher-2] [INFO] [1687263899.326229054] [robot_state_publisher]: got segment panda_link7
[robot_state_publisher-2] [INFO] [1687263899.326232738] [robot_state_publisher]: got segment panda_link8
[robot_state_publisher-2] [INFO] [1687263899.326236460] [robot_state_publisher]: got segment panda_rightfinger
[ros2_control_node-4] [INFO] [1687263899.330742547] [FrankaHardwareInterface]: Successfully connected to robot
[ros2_control_node-4] [INFO] [1687263899.330913043] [FrankaHardwareInterface]: Started
[ros2_control_node-4] *** stack smashing detected ***: terminated
[move_group-3] [WARN] [1687263899.347884343] [move_group.move_group]: MoveGroup launched without ~default_planning_pipeline specifying the namespace for the default planning pipeline configuration
[move_group-3] [WARN] [1687263899.347939356] [move_group.move_group]: Falling back to using the the move_group node namespace (deprecated behavior).
[move_group-3] Parsing robot urdf xml string.
[move_group-3] [INFO] [1687263899.350524591] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.00107411 seconds
[move_group-3] [INFO] [1687263899.350566474] [moveit_robot_model.robot_model]: Loading robot model 'panda'...
[move_group-3] [WARN] [1687263899.350684876] [moveit_robot_model.robot_model]: Link panda_leftfinger has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[move_group-3] [WARN] [1687263899.350694378] [moveit_robot_model.robot_model]: Link panda_rightfinger has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[move_group-3] Link panda_link1 had 1 children
[move_group-3] Link panda_link2 had 1 children
[move_group-3] Link panda_link3 had 1 children
[move_group-3] Link panda_link4 had 1 children
[move_group-3] Link panda_link5 had 1 children
[move_group-3] Link panda_link6 had 1 children
[move_group-3] Link panda_link7 had 1 children
[move_group-3] Link panda_link8 had 1 children
[move_group-3] Link panda_hand had 3 children
[move_group-3] Link panda_leftfinger had 0 children
[move_group-3] Link panda_rightfinger had 0 children
[move_group-3] Link panda_hand_tcp had 0 children
[move_group-3] [INFO] [1687263899.359032318] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene'
[move_group-3] [INFO] [1687263899.359280270] [moveit.ros_planning_interface.moveit_cpp]: Listening to 'joint_states' for joint states
[move_group-3] [INFO] [1687263899.359681038] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states'
[move_group-3] [INFO] [1687263899.359952838] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/attached_collision_object' for attached collision objects
[move_group-3] [INFO] [1687263899.359965933] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting planning scene monitor
[move_group-3] [INFO] [1687263899.360110771] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/planning_scene'
[move_group-3] [INFO] [1687263899.360120297] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.
[move_group-3] [INFO] [1687263899.360296714] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'collision_object'
[move_group-3] [INFO] [1687263899.360614594] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'planning_scene_world' for planning scene world geometry
[move_group-3] [WARN] [1687263899.360647388] [moveit.ros.occupancy_map_monitor]: Resolution not specified for Octomap. Assuming resolution = 0.1 instead
[move_group-3] [ERROR] [1687263899.360668757] [moveit.ros.occupancy_map_monitor]: No 3D sensor plugin(s) defined for octomap updates
[move_group-3] [INFO] [1687263899.361041416] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'move_group'
[move_group-3] [INFO] [1687263899.379534831] [moveit.ros_planning.planning_pipeline]: Using planning interface 'OMPL'
[move_group-3] [INFO] [1687263899.381456895] [moveit_ros.add_time_optimal_parameterization]: Param 'move_group.path_tolerance' was not set. Using default value: 0.100000
[move_group-3] [INFO] [1687263899.381473644] [moveit_ros.add_time_optimal_parameterization]: Param 'move_group.resample_dt' was not set. Using default value: 0.100000
[move_group-3] [INFO] [1687263899.381477395] [moveit_ros.add_time_optimal_parameterization]: Param 'move_group.min_angle_change' was not set. Using default value: 0.001000
[move_group-3] [INFO] [1687263899.381491806] [moveit_ros.fix_workspace_bounds]: Param 'move_group.default_workspace_bounds' was not set. Using default value: 10.000000
[move_group-3] [INFO] [1687263899.381503779] [moveit_ros.fix_start_state_bounds]: Param 'move_group.start_state_max_bounds_error' was set to 0.050000
[move_group-3] [INFO] [1687263899.381507943] [moveit_ros.fix_start_state_bounds]: Param 'move_group.start_state_max_dt' was not set. Using default value: 0.500000
[move_group-3] [INFO] [1687263899.381515514] [moveit_ros.fix_start_state_collision]: Param 'move_group.start_state_max_dt' was not set. Using default value: 0.500000
[move_group-3] [INFO] [1687263899.381519334] [moveit_ros.fix_start_state_collision]: Param 'move_group.jiggle_fraction' was not set. Using default value: 0.020000
[move_group-3] [INFO] [1687263899.381526278] [moveit_ros.fix_start_state_collision]: Param 'move_group.max_sampling_attempts' was not set. Using default value: 100
[move_group-3] [INFO] [1687263899.381534548] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Add Time Optimal Parameterization'
[move_group-3] [INFO] [1687263899.381560237] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links'
[move_group-3] [INFO] [1687263899.381563148] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds'
[move_group-3] [INFO] [1687263899.381565602] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds'
[move_group-3] [INFO] [1687263899.381567877] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision'
[move_group-3] [INFO] [1687263899.381570154] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints'
[rviz2-1] [INFO] [1687263899.584552584] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-1] [INFO] [1687263899.584708149] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-1] [INFO] [1687263899.605644592] [rviz2]: Stereo is NOT SUPPORTED
[ros2 run controller_manager spawner.py panda_arm_controller-7] [INFO] [1687263899.636606811] [spawner_panda_arm_controller]: Waiting for /controller_manager services
[ros2 run controller_manager spawner.py joint_state_broadcaster-8] [INFO] [1687263899.645879119] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[joint_state_publisher-5] [INFO] [1687263899.690138342] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...
[rviz2-1] Warning: class_loader.impl: SEVERE WARNING!!! A namespace collision has occurred with plugin factory for class rviz_default_plugins::displays::InteractiveMarkerDisplay. New factory will OVERWRITE existing one. This situation occurs when libraries containing plugins are directly linked against an executable (the one running right now generating this message). Please separate plugins out into their own library or just don't link against the library and use either class_loader::ClassLoader/MultiLibraryClassLoader to open.
[rviz2-1]          at line 253 in /opt/ros/foxy/include/class_loader/class_loader_core.hpp
[ERROR] [ros2_control_node-4]: process has died [pid 78712, exit code -6, cmd '/opt/ros/foxy/lib/controller_manager/ros2_control_node --ros-args --params-file /tmp/launch_params_8f_hiklk --params-file /home/zal2mu/race_franka_ws/install/franka_moveit_config/share/franka_moveit_config/config/panda_ros_controllers.yaml -r joint_states:=franka/joint_states'].
[INFO] [launch]: process[ros2_control_node-4] was required: shutting down launched system
[INFO] [ros2 run controller_manager spawner.py joint_state_broadcaster-8]: sending signal 'SIGINT' to process[ros2 run controller_manager spawner.py joint_state_broadcaster-8]
[INFO] [ros2 run controller_manager spawner.py panda_arm_controller-7]: sending signal 'SIGINT' to process[ros2 run controller_manager spawner.py panda_arm_controller-7]
[INFO] [franka_gripper_node-6]: sending signal 'SIGINT' to process[franka_gripper_node-6]
[INFO] [joint_state_publisher-5]: sending signal 'SIGINT' to process[joint_state_publisher-5]
[INFO] [move_group-3]: sending signal 'SIGINT' to process[move_group-3]
[INFO] [robot_state_publisher-2]: sending signal 'SIGINT' to process[robot_state_publisher-2]
[INFO] [rviz2-1]: sending signal 'SIGINT' to process[rviz2-1]
[franka_gripper_node-6] [INFO] [1687263900.489750108] [rclcpp]: signal_handler(signal_value=2)
[move_group-3] [INFO] [1687263900.490757135] [rclcpp]: signal_handler(signal_value=2)
[move_group-3] [WARN] [1687263900.491086623] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Waiting for panda_arm_controller/follow_joint_trajectory to come up
[move_group-3] [ERROR] [1687263900.491112082] [moveit.simple_controller_manager.follow_joint_trajectory_controller_handle]: Action client not connected: panda_arm_controller/follow_joint_trajectory
[robot_state_publisher-2] [INFO] [1687263900.491294643] [rclcpp]: signal_handler(signal_value=2)
[rviz2-1] [INFO] [1687263900.491871198] [rclcpp]: signal_handler(signal_value=2)
[rviz2-1] [ERROR] [1687263900.491989766] [moveit_ros_visualization.motion_planning_frame]: Action server: /recognize_objects not available
[move_group-3] [ERROR] [1687263900.493595294] [moveit_simple_controller_manager.rclcpp_action]: Error in destruction of rcl action client handle: action client implementation is invalid, at /tmp/binarydeb/ros-foxy-rcl-action-1.1.14/src/rcl_action/action_client.c:470
[move_group-3] [ERROR] [1687263900.493633561] [moveit.plugins.moveit_simple_controller_manager]: Caught unknown exception while parsing controller information
[move_group-3] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[move_group-3]   what():  Failed to create interrupt guard condition in Executor constructor: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/guard_condition.c:67
[rviz2-1] 
[rviz2-1] >>> [rcutils|error_handling.c:108] rcutils_set_error_state()
[rviz2-1] This error state is being overwritten:
[rviz2-1] 
[rviz2-1]   'rcl node's context is invalid, at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/node.c:441'
[rviz2-1] 
[rviz2-1] with this new error message:
[rviz2-1] 
[rviz2-1]   'the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/guard_condition.c:67'
[rviz2-1] 
[rviz2-1] rcutils_reset_error() should be called after error handling to avoid this.
[rviz2-1] <<<
[rviz2-1] [ERROR] [1687263900.496388524] [rviz2]: Could not load display config: failed to create interrupt guard condition: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at /tmp/binarydeb/ros-foxy-rcl-1.1.14/src/rcl/guard_condition.c:67
[INFO] [robot_state_publisher-2]: process has finished cleanly [pid 78708]
[INFO] [franka_gripper_node-6]: process has finished cleanly [pid 78716]
[INFO] [joint_state_publisher-5]: process has finished cleanly [pid 78714]
[ros2 run controller_manager spawner.py panda_arm_controller-7] [INFO] [1687263901.654779916] [spawner_panda_arm_controller]: Waiting for /controller_manager services
[ERROR] [move_group-3]: process has died [pid 78710, exit code -6, cmd '/opt/ros/foxy/lib/moveit_ros_move_group/move_group --ros-args --params-file /tmp/launch_params_w4xf71hn --params-file /tmp/launch_params_y8xocb33 --params-file /tmp/launch_params_6k30ed9p --params-file /tmp/launch_params_lzsh87ix --params-file /tmp/launch_params_gbuy8ybk --params-file /tmp/launch_params_5uc0ww9y --params-file /tmp/launch_params_2o3rn4c1'].
[ros2 run controller_manager spawner.py joint_state_broadcaster-8] [INFO] [1687263901.663186013] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[ERROR] [rviz2-1]: process has died [pid 78706, exit code -11, cmd '/opt/ros/foxy/lib/rviz2/rviz2 -d /home/zal2mu/race_franka_ws/install/franka_moveit_config/share/franka_moveit_config/rviz/moveit.rviz --ros-args -r __node:=rviz2 --params-file /tmp/launch_params_jtq09j2c --params-file /tmp/launch_params_j5iauie7 --params-file /tmp/launch_params_82ub_iri --params-file /tmp/launch_params_ehbhttvu'].
[ros2 run controller_manager spawner.py panda_arm_controller-7] [INFO] [1687263903.675492452] [spawner_panda_arm_controller]: Waiting for /controller_manager services
[ros2 run controller_manager spawner.py joint_state_broadcaster-8] [INFO] [1687263903.683411307] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[ERROR] [ros2 run controller_manager spawner.py joint_state_broadcaster-8]: process[ros2 run controller_manager spawner.py joint_state_broadcaster-8] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[ERROR] [ros2 run controller_manager spawner.py panda_arm_controller-7]: process[ros2 run controller_manager spawner.py panda_arm_controller-7] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [ros2 run controller_manager spawner.py joint_state_broadcaster-8]: sending signal 'SIGTERM' to process[ros2 run controller_manager spawner.py joint_state_broadcaster-8]
[INFO] [ros2 run controller_manager spawner.py panda_arm_controller-7]: sending signal 'SIGTERM' to process[ros2 run controller_manager spawner.py panda_arm_controller-7]
[ERROR] [ros2 run controller_manager spawner.py panda_arm_controller-7]: process has died [pid 78718, exit code -15, cmd 'ros2 run controller_manager spawner.py panda_arm_controller'].
[ERROR] [ros2 run controller_manager spawner.py joint_state_broadcaster-8]: process has died [pid 78721, exit code -15, cmd 'ros2 run controller_manager spawner.py joint_state_broadcaster'].
marcbone commented 1 year ago

[ros2_control_node-4] stack smashing detected : terminated

This line really concerns me. Do the other launch files work for you?

laibazahid26 commented 1 year ago

The communication test with the robot that is part of the libfranka, succeeds. I am able to move the real robot from a random joint configuration to the initial joint configuration.

But the other launch files for example the below one also does not work and gives me the same stack smashing error

ros2 launch franka_bringup move_to_start_example_controller.launch.py robot_ip:=<fci-ip>
laibazahid26 commented 1 year ago

The problem is solved. I had multiple versions of libfranka installed in their respective workspace and one of them was installed globally. These versions seemed to be colliding together.

Uninstalling libfranka from everywhere and then installing again worked for me.