Setting waypoint error


#1

Hello,

I am trying to set a new waypoint using the C++ API referred in the documentation. However, I am getting compilation errors.

waypoints_array.pushback(waypoint)
nav.waypoint_set(waypoints_array);

Error message:

error: ‘class std::vector<mavros_msgs::Waypoint_<std::allocator<void> >, std::allocator<mavros_msgs::Waypoint_<std::allocator<void> > > >’ has no member named ‘pushback’
  waypoints_array.pushback(waypoint);

error: no matching function for call to ‘Navigation::waypoint_set(mavros_msgs::Waypoint&)’
  nav.waypoint_set(waypoint);

Could it be that the documentation is not updated?


#2

Please replace pushback with push_back. This is a bug in api docs.

it seems somewhere in your code (which you have not shared), has this statement. Please change it to:
nav.waypoint_set(waypoints_array);