Skip to content

Commit 68e56a2

Browse files
MihirDharmadhikarivooon
authored andcommitted
Handling empty trajectory message
1 parent e38a741 commit 68e56a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mavros/src/plugins/setpoint_trajectory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ class SetpointTrajectoryPlugin : public plugin::PluginBase,
123123
{
124124
lock_guard lock(mutex);
125125

126+
if (req->points.empty()) {
127+
ROS_WARN_NAMED("setpoint_trajectory", "Empty trajectory received");
128+
return;
129+
}
130+
126131
if(static_cast<MAV_FRAME>(mav_frame) == MAV_FRAME::BODY_NED || static_cast<MAV_FRAME>(mav_frame) == MAV_FRAME::BODY_OFFSET_NED){
127132
transform = ftf::StaticTF::BASELINK_TO_AIRCRAFT;
128133
} else {

0 commit comments

Comments
 (0)