Trouble setting waypoints and running a mission using mavros

asked 2019-05-02 09:19:34 -0500

Drkstr gravatar image

I am trying to create a set of waypoints, add them to a waypoint list and then fly a mission using rospy and MAVROS.

I could not find any python sample code. So, I tried to figure it out on my own. Unfortunately, I did not have much luck.

Here is the code I am using to create a waypoint and add it to the waypointlist.

    def create_waypoint(self):
        latitude = self.current_location.latitude
        longitude = self.current_location.longitude

        waypoint = Waypoint()
        waypoint.x_lat = latitude
        waypoint.y_long = longitude
        waypoint.autocontinue = True
        waypoint.is_current = False
        waypoint.frame = Waypoint.FRAME_GLOBAL
        waypoint.command = CommandCode.NAV_WAYPOINT


I get an error message saying "AttributeError: 'member_descriptor' object has no attribute 'push_back'" when I do the push_back(waypoint)

This is how I am trying to start the mission after setting the waypoints:

    def start_waypoint_mission(self):
    except rospy.ServiceException, e:
        print "Service arm call failed: %s" % e

    except rospy.ServiceException, e:
        print "Service arm call failed: %s" % e


  • What is the correct method for creating a waypointlist and running a mission?
  • Where can I find some python sample code for doing this?
edit retag flag offensive close merge delete


Hey, i was doing a similar task. I want to know if you figured the correct way out ad if you can help me with it?

Mohit Singh gravatar image Mohit Singh  ( 2019-05-24 07:25:03 -0500 )edit