Skip to content

check_waypoint_reached() causes the drone to land #7

@joaopsousa99

Description

@joaopsousa99

Hello,

First of all, I'm sorry if this is not the appropriate way to report an issue, I'm new to the Github and its community.

I am running a simple ROS Noetic node which prompts the drone to takeoff and publish a Boolean message which indicates if it has finished taking off.

#! /usr/bin/python3
import rospy
from iq_gnc.py_gnc_functions import *
from iq_gnc.PrintColours import *
from std_msgs.msg import Bool

def takeoff():
    nh = rospy.Publisher("takeoff", Bool, queue_size=10)
    rospy.init_node("takeoff", anonymous=True)
    rate = rospy.Rate(3) # 3Hz

    drone = gnc_api()
    drone.wait4connect()
    drone.set_mode("GUIDED")
    drone.wait4start()
    drone.initialize_local_frame()
    drone.takeoff(3)

    takeoff_complete = Bool()

    while not rospy.is_shutdown():
        takeoff_complete.data = drone.check_waypoint_reached()
        nh.publish(takeoff_complete)
        rate.sleep()

if __name__ == '__main__':
    try:
        takeoff()
    except rospy.ROSInterruptException:
        pass

At first, I didn't know what was causing the drone to land so I commented out some sections and uncommented them line by line to find the issue and it turns out it's takeoff_complete.data = drone.check_waypoint_reached(). Is this intended behaviour? How can I work around this while still checking if the drone has finished landing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions