OMPL seg fault on Jetson tx2i
I have been testing with OMPL planner in simulation (Gazebo+ROS+RViz+C++) on an AMD machine for a while now without any issues, and recently tried to run my code on a Jetson tx2i (ARM). catkin build
compiles and builds my workspace just fine but as soon as I launch my OMPL planner, the planner node crashes. I used gdb to look into this, an it seems the RRTStar planner function is causing issues. However, I don't know why it works on AMD platform but not on ARM. The gdb trace is attached below for reference.
#0 0x0000007fb794185c in __GI___libc_free (mem=0x55) at malloc.c:3113
#1 0x0000007fb639b4bc in ompl::base::RealVectorStateSpace::freeState(ompl::base::State*) const () at /opt/ros/melodic/lib/libompl.so.15
#2 0x0000007fb6551e7c in ompl::geometric::RRTstar::freeMemory() ()
at /opt/ros/melodic/lib/libompl.so.15
#3 0x0000007fb6552a1c in ompl::geometric::RRTstar::~RRTstar() ()
at /opt/ros/melodic/lib/libompl.so.15
#4 0x0000007fb77d2300 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() (this=0x7f7c084a70) at /usr/include/c++/7/bits/shared_ptr_base.h:154
#5 0x0000007fb77d2300 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() (this=<synthetic pointer>,
__in_chrg=<optimized out>)
at /usr/include/c++/7/bits/shared_ptr_base.h:684
#6 0x0000007fb77d2300 in std::__shared_ptr<ompl::base::Planner, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() (this=<synthetic pointer>,
__in_chrg=<optimized out>) at /usr/include/c++/7/bits/shared_ptr_base.h:1123
#7 0x0000007fb77d2300 in std::shared_ptr<ompl::base::Planner>::~shared_ptr() (this=<synthetic pointer>,
__in_chrg=<optimized out>)
at /usr/include/c++/7/bits/shared_ptr.h:93
#8 0x0000007fb77d2300 in motion_plan::route_planner::RoutePlanner::PlanOMPL(MissionWaypoint const&, MissionWaypoint const&, std::shared_ptr<ompl::base::SpaceInformation>, double const&, motion_plan::route_planner::PlanningParams const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > >&, double&) (this=this@entry=0x5555bc9c90, start_in=..., ---Type <return> to continue, or q <return> to quit--- goal_in=..., plan_state_ptr=Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 0x4010000000000000:
#9 0x0000007fb77d3078 in motion_plan::route_planner::RoutePlanner::Run(Mission const&, std::vector<Mission, std::allocator<Mission> >&) (this=0x5555bc9c90, start_goal_locations=..., trajectory_out=std::vector of length
-5248512, capacity -164395 = {...})
at /home/nea/nea_src/firefly-autonomy/src/planning/route_planner/src/route_planner.cpp:444
#10 0x0000007fb7f40f38 in motion_plan::RoutePlannerThread::updatePlannerRRTS() (this=0x5555bc9330) at /home/nea/nea_src/firefly-autonomy/src/planning/planning_manager/src/plan_thread/route_planner_thread.cpp:371
#11 0x0000007fb7f42054 in motion_plan::RoutePlannerThread::updateInThread() (this=<optimized out>) at /home/nea/nea_src/firefly-autonomy/src/planning/planning_manager/src/plan_thread/route_planner_thread.cpp:245
#12 0x0000007fb7f3c740 in motion_plan::PlanThread::runThread() (this=0x5555bc9330) at /home/nea/nea_src/firefly-autonomy/src/planning/planning_manager/src/plan_thread/plan_thread.cpp:74
#13 0x0000007fb7b02e94 in () at /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#14 0x0000007fb78a5088 in start_thread (arg=0x7fffffb93f) at pthread_create.c:463
#15 0x0000007fb7999ffc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78