You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set mode offboard via RC, then arm and takeoff automatically by ros2 node
After 20 seconds, drone land and disarm the propeller.
But my issues is:
When the land_trigger is true, drone land on the ground but can not disarm and takeoff again.
`#!/usr/bin/env python3
import rclpy
from rclpy.node import Node
from mavros_msgs.srv import CommandBool, CommandTOL, SetMode
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import State
from rclpy.qos import QoSProfile, QoSReliabilityPolicy, QoSDurabilityPolicy
Here my node using mavros API with some features:
But my issues is:
When the land_trigger is true, drone land on the ground but can not disarm and takeoff again.
`#!/usr/bin/env python3
import rclpy
from rclpy.node import Node
from mavros_msgs.srv import CommandBool, CommandTOL, SetMode
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import State
from rclpy.qos import QoSProfile, QoSReliabilityPolicy, QoSDurabilityPolicy
class OffBoardControlNode(Node):
def init(self):
super().init("drone_offboard_control")
self.get_logger().info("Starting offboard control node...")
self.state = State()
self.flight_start_time = self.get_clock().now()
self.takeoff_height = 2.0
self.takeoff_triggered = False
self.landing_triggered = False
def main(args=None):
rclpy.init(args=args)
node = OffBoardControlNode()
try:
rclpy.spin(node)
except KeyboardInterrupt:
pass
finally:
node.destroy_node()
rclpy.shutdown()
if name == "main":
main()
`
The text was updated successfully, but these errors were encountered: