raaslab / mavros_offboard_control

MAVROS offboard control
29 stars 12 forks source link

run uavspiralmotion show a problem #2

Closed YCH188 closed 6 years ago

YCH188 commented 6 years ago

when I run uavspiralmotion node I get a problem as follow 2018-05-17 21-21-29

I found this is because this part in uavspiralmotion.cpp

local_pos_pub.publish(waypoint_pose[waypoint_count]); if (abs(current_pose.pose.position.x - waypoint_pose[waypoint_count].pose.position.x) < 0.2 && abs(current_pose.pose.position.y - waypoint_pose[waypoint_count].pose.position.y) < 0.2 && abs(current_pose.pose.position.z - waypoint_pose[waypoint_count].pose.position.z) < 0.2) { waypoint_count += 1;

    // ROS_INFO("waypoint_count = %d, cur_pos = (%.2f, %.2f, %.2f), next_pos = (%.2f, %.2f, %.2f)", waypoint_count,
    //     current_pose.pose.position.x, current_pose.pose.position.y, current_pose.pose.position.z,
    //     waypoint_pose[waypoint_count].pose.position.x, waypoint_pose[waypoint_count].pose.position.y, waypoint_pose[waypoint_count].pose.position.z);
}

Hope for your help

kevinlyu1 commented 6 years ago

Could you place the text in English?

YCH188 commented 6 years ago

The error text is "Segmentation fault(core dumped)". The code which caused the error can be found in UAVSpiralMotion.cpp under the folder in src. The variable waypoint_pose is a vector of PoseStamped. I tried to debug, and found it is because of it. But I didn't know how to fix it.

kevinlyu1 commented 6 years ago

Could you explain how you figured out it was those lines of code?

A problem could be your computer is running out of memory space.

YCH188 commented 6 years ago

I have commented these part of code and then the node can run. But the UAV did not fly in spiral line. Have you tried uav_spiral_motion node and got no problem?

kevinlyu1 commented 6 years ago

Yes we have tried it and it works. I believe your computer does not have enough memory for it. Unless you can provide more information on this problem there is nothing I can do to help debug it.