moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
982 stars 492 forks source link

Segmentation Fault when using a different planner in the pick & place demo #2878

Open karanchahal opened 1 week ago

karanchahal commented 1 week ago

Description

When I modify the pick and [place demo by adding a new planner (nvidia cumotion planner), I hit a segmentation fault when the task that uses the cumotion planner is executed. This is not any error in the cumotion planner which returns a plan successfully but my move it task mtc node is not being able to read the message and causing an Address not mapped error.

Your environment

Steps to reproduce

Add a new planner in the code:

auto cumotion_sampling_planner = std::make_shared<solvers::PipelinePlanner>(node, "isaac_ros_cumotion");
    cumotion_sampling_planner->setProperty("goal_joint_tolerance", 1e-5);
...
/****************************************************
     *                                                  *
     *               Move to Pick                       *
     *                                                  *
     ***************************************************/
    {  // Move-to pre-grasp
        auto stage = std::make_unique<stages::Connect>(
            "move to pick", stages::Connect::GroupPlannerVector{ { params.arm_group_name, cumotion_sampling_planner } });
        stage->setTimeout(5.0);
        stage->properties().configureInitFrom(Stage::PARENT);
        // initial_state_ptr = stage.get();
        t.add(std::move(stage));
    }

Expected behaviour

The plan shou;ld be executed and shown in rviz

Actual behaviour

ctory
[pick_place_demo-1] [INFO] [1719169477.331862724] [moveit_task_constructor_demo]: Sending goal
[pick_place_demo-1] [INFO] [1719169477.341134866] [moveit_task_constructor_demo]: Goal accepted by server, waiting for result
[pick_place_demo-1] Stack trace (most recent call last) in thread 680136:
[pick_place_demo-1] #22   Object "", at 0xffffffffffffffff, in 
[pick_place_demo-1] #21   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7fce84306a3f, in 
[pick_place_demo-1] #20   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7fce84274ac2, in 
[pick_place_demo-1] #19   Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7fce84506252, in 
[pick_place_demo-1] #18   Object "/pick_place_demo", at 0x55a59a754a30, in std::thread::_State_impl<std::thread::_Invoker<std::tuple<main::{lambda()#1}> > >::_M_run()
[pick_place_demo-1] #17   Object "/opt/ros/humble/lib/librclcpp.so", at 0x7fce8477ec3e, in rclcpp::spin(std::shared_ptr<rclcpp::Node>)
[pick_place_demo-1] #16   Object "/opt/ros/humble/lib/librclcpp.so", at 0x7fce8477eb44, in rclcpp::spin(std::shared_ptr<rclcpp::node_interfaces::NodeBaseInterface>)
[pick_place_demo-1] #15   Object "/opt/ros/humble/lib/librclcpp.so", at 0x7fce8477e920, in rclcpp::executors::SingleThreadedExecutor::spin()
[pick_place_demo-1] #14   Object "/opt/ros/humble/lib/librclcpp.so", at 0x7fce8477741c, in rclcpp::Executor::get_next_executable(rclcpp::AnyExecutable&, std::chrono::duration<long, std::ratio<1l, 1000000000l> >)
[pick_place_demo-1] #13   Object "/opt/ros/humble/lib/librclcpp.so", at 0x7fce8477734e, in rclcpp::Executor::get_next_ready_executable_from_map(rclcpp::AnyExecutable&, std::map<std::weak_ptr<rclcpp::CallbackGroup>, std::weak_ptr<rclcpp::node_interfaces::NodeBaseInterface>, std::owner_less<std::weak_ptr<rclcpp::CallbackGroup> >, std::allocator<std::pair<std::weak_ptr<rclcpp::CallbackGroup> const, std::weak_ptr<rclcpp::node_interfaces::NodeBaseInterface> > > > const&)
[pick_place_demo-1] #12   Object "/opt/ros/humble/lib/librclcpp_action.so", at 0x7fce83af051b, in rclcpp_action::ClientBase::take_data()
[pick_place_demo-1] #11   Object "/opt/ros/humble/lib/librcl_action.so", at 0x7fce83ad45bc, in rcl_action_take_result_response
[pick_place_demo-1] #10   Object "/opt/ros/humble/lib/librcl.so", at 0x7fce83ddea25, in rcl_take_response
[pick_place_demo-1] #9    Object "/opt/ros/humble/lib/librcl.so", at 0x7fce83dde76c, in rcl_take_response_with_info
[pick_place_demo-1] #8    Object "/opt/ros/humble/lib/librmw_fastrtps_shared_cpp.so", at 0x7fce81527637, in rmw_fastrtps_shared_cpp::__rmw_take_response(char const*, rmw_client_s const*, rmw_service_info_s*, void*, bool*)
[pick_place_demo-1] #7    Object "/opt/ros/humble/lib/librmw_fastrtps_cpp.so", at 0x7fce81582bb8, in 
[pick_place_demo-1] #6    Object "/ros_ws/install/moveit_msgs/lib/libmoveit_msgs__rosidl_typesupport_fastrtps_cpp.so", at 0x7fce7c35bc2c, in moveit_msgs::action::typesupport_fastrtps_cpp::_MoveGroup_GetResult_Response__cdr_deserialize(eprosima::fastcdr::Cdr&, void*)
[pick_place_demo-1] #5    Object "ros_ws/install/moveit_msgs/lib/libmoveit_msgs__rosidl_typesupport_fastrtps_cpp.so", at 0x7fce7c35ba0b, in moveit_msgs::action::typesupport_fastrtps_cpp::cdr_deserialize(eprosima::fastcdr::Cdr&, moveit_msgs::action::MoveGroup_GetResult_Response_<std::allocator<void> >&)
[pick_place_demo-1] #4    Object "/ros_ws/install/moveit_msgs/lib/libmoveit_msgs__rosidl_typesupport_fastrtps_cpp.so", at 0x7fce7c35a598, in moveit_msgs::action::typesupport_fastrtps_cpp::cdr_deserialize(eprosima::fastcdr::Cdr&, moveit_msgs::action::MoveGroup_Result_<std::allocator<void> >&)
[pick_place_demo-1] #3    Object "os_ws/install/moveit_msgs/lib/libmoveit_msgs__rosidl_typesupport_fastrtps_cpp.so", at 0x7fce7c334aef, in moveit_msgs::msg::typesupport_fastrtps_cpp::cdr_deserialize(eprosima::fastcdr::Cdr&, moveit_msgs::msg::MoveItErrorCodes_<std::allocator<void> >&)
[pick_place_demo-1] #2    Object "/install/moveit_msgs/lib/libmoveit_msgs__rosidl_typesupport_fastrtps_cpp.so", at 0x7fce7c30e6fa, in eprosima::fastcdr::Cdr::operator>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)
[pick_place_demo-1] #1    Object "ros_ws/install/moveit_msgs/lib/libmoveit_msgs__rosidl_typesupport_fastrtps_cpp.so", at 0x7fce7c30b54b, in eprosima::fastcdr::Cdr::deserialize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)
[pick_place_demo-1] #0    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7fce84576569, in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
[pick_place_demo-1] Segmentation fault (Address not mapped to object [(nil)])
[ERROR] [pick_place_demo-1]: process has died [pid 680123, exit code -11, cmd '/pick_place_demo --ros-args --params-file _pick_and_place/config/panda_config.yaml --params-file /tmp/launch_params_c3kkiavu --params-file /tmp/launch_params_kranhjdb --params-file /tmp/launch_params_8w289rl6 --params-file /tmp/launch_params_9bwjxh9l --params-file /tmp/launch_params_jj6sut3w'].

Backtrace or Console output

Use gist.github.com to copy-paste the console output or segfault backtrace using gdb.

karanchahal commented 1 week ago

I tried cyclone dds as well by the way same result.