pad • Publishes target position/velocity messages • Commander • Subscribes to vehicle state and position messages • Subscribes to target tracker messages • Controls vehicle velocity
""" Capture frames from the camera and publish them. """ self.wait_for_position() ! while not rospy.is_shutdown(): frame = self.camera.get_frame() if frame is not None: position, velocity = \ self.process_frame(frame) self.publish_track(position, velocity)
object std_msgs/Bool is_tracking ! # Relative position and velocity of the tracked object geometry_msgs/Vector3 position geometry_msgs/Vector3 velocity
""" Spin the ROS event loop, running the active flight controller on each iteration. """ while not rospy.is_shutdown(): self.controller.run() self.control_loop_rate.sleep()
""" Handle mavros/State messages, published by the FCU at ~1 Hz. """ mode = msg.mode ! if (mode in GUIDED_MODES and self.state == FlightState.PENDING): self.transition_to_state(FlightState.SEEK) ! elif (mode not in GUIDED_MODES and self.state != FlightState.PENDING): self.transition_to_state(FlightState.PENDING)
def set_location_setpoint(self, setpoint): """ Publish a SET_POSITION_TARGET_LOCAL_NED message with position x, y, z and yaw. """ x, y, z, yaw = setpoint ! msg = geometry_msgs.msg.PoseStamped() msg.pose.position.x = x msg.pose.position.y = y msg.pose.position.z = z msg.pose.orientation.z = yaw ! self.location_setpoint_publisher.publish(msg)
high-gain antenna and an antenna tracker (a.k.a. unsuspecting friend or bystander) • sudo apt-‐get remove wpasupplicant • GSM? • Use image_transport to transmit compressed images