Commit e6ed6faf authored by Larkin Heintzman's avatar Larkin Heintzman

image updates

parent ab92c04e
[submodule "motion_capture_system"] [submodule "motion_capture_system"]
path = motion_capture_system path = motion_capture_system
url = https://github.com/KTH-SML/motion_capture_system.git url = https://github.com/KTH-SML/motion_capture_system.git
[submodule "image_common"]
path = image_common
url = https://github.com/ros-perception/image_common
[submodule "image_pipeline"]
path = image_pipeline
url = https://github.com/ros-perception/image_pipeline
[submodule "video_stream_opencv"]
path = video_stream_opencv
url = https://github.com/ros-drivers/video_stream_opencv
[submodule "vision_opencv"]
path = vision_opencv
url = https://github.com/ros-perception/vision_opencv
...@@ -7,14 +7,27 @@ ...@@ -7,14 +7,27 @@
<!-- <param name="/use_sim_time" value="true"/> --> <!-- <param name="/use_sim_time" value="true"/> -->
<node name="waypointGenerator" pkg="database_tools" type="waypointGenerator.py"> <node name="waypointGenerator" pkg="database_tools" type="waypointGenerator.py">
<!-- type of path, from "points" below, "spiral", or "squares" -->
<param name="pathType" type="string" value="spiral"/>
<param name="spiralRadius" type="double" value="1"/>
<param name="spiralLoops" type="double" value="2"/>
<param name="spiralHeight" type="double" value="1"/>
<param name="altitudeIncrement" type="double" value="0"/>
<!-- base altitude of all waypoints/position -->
<param name="altitude" type="double" value="2"/>
<!-- number of drones to generate waypoints for -->
<param name="droneNum" type="double" value="3"/>
<rosparam command="load" param="anchorPoint"> <rosparam command="load" param="anchorPoint">
<!-- kentland airstrip anchor point --> <!-- kentland airstrip anchor point -->
<!-- [37.197280, -80.577791] --> <!-- [37.197280, -80.577791] -->
<!-- [37.196986, -80.578257] --> <!-- [37.196986, -80.578257] -->
<!-- long distance tests, kentland --> <!-- long distance tests, kentland -->
[37.196941, -80.578335] <!-- [37.196941, -80.578335] -->
<!-- kentland airstrip anchor point --> <!-- kentland airstrip anchor point -->
<!-- [37.223166, -80.432788] --> <!-- [37.223166, -80.432788] -->
<!-- backyard center -->
[37.227531, -80.406156]
</rosparam> </rosparam>
<!-- nearby tree variation --> <!-- nearby tree variation -->
<rosparam command="load" param="pathPoints"> <rosparam command="load" param="pathPoints">
...@@ -26,6 +39,7 @@ ...@@ -26,6 +39,7 @@
[37.197879, -80.576637] --> [37.197879, -80.576637] -->
] ]
</rosparam> </rosparam>
<!-- back tree line variation --> <!-- back tree line variation -->
<!-- <rosparam command="load" param="pathPoints"> <!-- <rosparam command="load" param="pathPoints">
[ [
...@@ -54,16 +68,12 @@ ...@@ -54,16 +68,12 @@
] ]
</rosparam> --> </rosparam> -->
<!-- set altitude of all waypoints -->
<rosparam command="load" param="altitude"> 10.0 </rosparam>
<!-- number of drones to generate waypoints for -->
<rosparam command="load" param="droneNum"> 3 </rosparam>
</node> </node>
<!-- then the real qualisys provides the track to follow TESTING --> <!-- then the real qualisys provides the track to follow -->
<!-- <group ns="tracking"> <!-- <group ns="feedback">
<include file="$(find mocap_qualisys)/launch/qualisys.launch"> <include file="$(find mocap_qualisys)/launch/qualisys.launch">
<arg name="server_address" value="192.168.1.207"/> <arg name="server_address" value="192.168.1.199"/>
</include> </include>
</group> --> </group> -->
...@@ -71,7 +81,8 @@ ...@@ -71,7 +81,8 @@
<!-- define all names parameter --> <!-- define all names parameter -->
<rosparam command="load" param="nameList"> <rosparam command="load" param="nameList">
<!-- ["nerudaQual", "plathQual"] --> <!-- ["nerudaQual", "plathQual"] -->
["plathModem"] <!-- ["plathModem"] -->
["plathHouse"]
</rosparam> </rosparam>
<!-- turn on gui interface --> <!-- turn on gui interface -->
...@@ -81,7 +92,7 @@ ...@@ -81,7 +92,7 @@
<!-- launch neruda vehicle nodes --> <!-- launch neruda vehicle nodes -->
<include file="$(find base_station)/launch/remote_vehicle.launch"> <include file="$(find base_station)/launch/remote_vehicle.launch">
<arg name="machine_name" value="plathModem"/> <arg name="machine_name" value="plathHouse"/>
<arg name="machine_id" value="0"/> <arg name="machine_id" value="0"/>
</include> </include>
......
<launch>
<!-- define all names parameter -->
<rosparam command="load" param="nameList">
["nerudaHouse"]
</rosparam>
<!-- load machine names, plath, neruda, and home versions -->
<include file="$(find base_station)/launch/machines.launch"/>
<node name="waypointGenerator" pkg="database_tools" type="waypointGenerator.py">
<!-- type of path, from "points" below, "spiral", or "squares" -->
<param name="pathType" type="string" value="spiral"/>
<param name="spiralRadius" type="double" value="1"/>
<param name="spiralLoops" type="double" value="2"/>
<param name="spiralHeight" type="double" value="1"/>
<param name="altitudeIncrement" type="double" value="0"/>
<!-- base altitude of all waypoints/position -->
<param name="altitude" type="double" value="2"/>
<!-- number of drones to generate waypoints for -->
<param name="droneNum" type="double" value="3"/>
<rosparam command="load" param="anchorPoint">
<!-- backyard center -->
[37.227531, -80.406156]
</rosparam>
<!-- nearby tree variation -->
<rosparam command="load" param="pathPoints">
[]
</rosparam>
</node>
<!-- launch neruda vehicle nodes -->
<include file="$(find base_station)/launch/remote_image_test.launch">
<arg name="machine_name" value="nerudaHouse"/>
<arg name="machine_id" value="0"/>
</include>
</launch>
<launch>
<!-- argument for machine name -->
<arg name="machine_name"/>
<!-- argument for machine id -->
<arg name="machine_id"/>
<group ns="$(arg machine_name)">
<!-- run viewer on base station laptop -->
<node name="imageViewer" pkg="base_station" type="imageViewerNode.py"/>
<!-- run webcam stream on remote node -->
<!-- got to do this here because including a file to a remote machine is apparently frowned upon -->
<arg name="camera_name" default="usb_camera" />
<!-- video_stream_provider can be a number as a video device or a url of a video stream -->
<arg name="video_stream_provider" default="0" />
<!-- set camera fps to -->
<arg name="set_camera_fps" default="30" />
<!-- set buffer queue size of frame capturing to -->
<arg name="buffer_queue_size" default="100" />
<!-- frames per second to query the camera for -->
<arg name="fps" default="30" />
<!-- frame_id for the camera -->
<arg name="frame_id" default="$(arg camera_name)" />
<!-- By default, calibrations are stored to file://${ROS_HOME}/camera_info/${NAME}.yaml
To use your own fill this arg with the corresponding url, e.g.:
"file:///$(find your_camera_package)/config/your_camera.yaml" -->
<arg name="camera_info_url" default="" />
<!-- flip the image horizontally (mirror it) -->
<arg name="flip_horizontal" default="false" />
<!-- flip the image vertically -->
<arg name="flip_vertical" default="false" />
<!-- force width and height, 0 means no forcing -->
<arg name="width" default="0"/>
<arg name="height" default="0"/>
<!-- enable looping playback, only if video_stream_provider is a video file -->
<arg name="loop_videofile" default="false" />
<arg name="start_frame" default="0"/>
<arg name="stop_frame" default="-1"/>
<!-- if show a image_view window subscribed to the generated stream -->
<arg name="visualize" default="false"/>
<!-- images will be published at /camera_name/image with the image transports plugins (e.g.: compressed) installed -->
<group ns="$(arg camera_name)">
<node pkg="video_stream_opencv" type="video_stream" name="$(arg camera_name)_stream" output="screen" machine="$(arg machine_name)">
<remap from="camera" to="image_raw" />
<param name="camera_name" type="string" value="$(arg camera_name)" />
<param name="video_stream_provider" type="string" value="$(arg video_stream_provider)" />
<param name="set_camera_fps" type="double" value="$(arg set_camera_fps)" />
<param name="buffer_queue_size" type="int" value="$(arg buffer_queue_size)" />
<param name="fps" type="double" value="$(arg fps)" />
<param name="frame_id" type="string" value="$(arg frame_id)" />
<param name="camera_info_url" type="string" value="$(arg camera_info_url)" />
<param name="flip_horizontal" type="bool" value="$(arg flip_horizontal)" />
<param name="flip_vertical" type="bool" value="$(arg flip_vertical)" />
<param name="loop_videofile" type="bool" value="$(arg loop_videofile)" />
<param name="start_frame" type="int" value="$(arg start_frame)" />
<param name="stop_frame" type="int" value="$(arg stop_frame)" />
<param name="width" type="int" value="$(arg width)" />
<param name="height" type="int" value="$(arg height)" />
</node>
</group>
</group>
</launch>
...@@ -27,26 +27,29 @@ ...@@ -27,26 +27,29 @@
<!-- camera_type to use for images, 0 for fpv camera and 1 for gimbal camera --> <!-- camera_type to use for images, 0 for fpv camera and 1 for gimbal camera -->
<param name="camera_type" type="int" value="1"/> <param name="camera_type" type="int" value="1"/>
<!-- base movement speed through waypoints --> <!-- base movement speed through waypoints -->
<param name="base_speed" type="double" value="4.0"/> <param name="base_speed" type="double" value="2.0"/>
<!-- maximum speed for waypoint traverse --> <!-- maximum speed for waypoint traverse -->
<param name="max_speed" type="double" value="4.0"/> <param name="max_speed" type="double" value="3.0"/>
<!-- relative motion speed scalar --> <!-- relative motion speed scalar -->
<param name="speed_scalar" type="double" value="1"/> <param name="speed_scalar" type="double" value="0.0"/>
<!-- <param name="speed_scalar" type="double" value="5.0"/> --> <!-- <param name="speed_scalar" type="double" value="5.0"/> -->
<!-- minimum allowed speed during relative motion --> <!-- minimum allowed speed during relative motion -->
<param name="min_speed" type="double" value="0.01"/> <param name="min_speed" type="double" value="0.01"/>
<!-- maximum yaw speed degs/s --> <!-- maximum yaw speed degs/s -->
<param name="max_yaw_speed" type="double" value="5.0"/> <param name="max_yaw_speed" type="double" value="5.0"/>
<!-- <param name="max_yaw_speed" type="double" value="0.0"/> --> <!-- distance to target position before moving on to next -->
<!-- whether we are mimicing playback or not --> <param name="position_threshold" type="double" value="0.5"/>
<!-- <param name="position_playback" type="bool" value="true"/> -->
<param name="position_playback" type="bool" value="false"/> <!-- what type of mission? "tracking", "points", or "puredata" -->
<param name="mission_type" type="string" value="points"/>
<!-- actual control loop time lol --> <!-- actual control loop time lol -->
<param name="loop_rate" type="double" value="5"/> <param name="loop_rate" type="double" value="20"/>
<!-- inverse controller damping value --> <!-- inverse controller damping value -->
<param name="controller_damping" type="double" value="20"/> <param name="controller_damping" type="double" value="2"/>
<!-- inverse controller frequency value --> <!-- inverse controller frequency value -->
<param name="controller_frequency" type="double" value="0.2"/> <param name="controller_frequency" type="double" value="1"/>
<!-- physical angle offset between drone frame and qual spoof frame -->
<param name="angle_offset" type="double" value="0.0"/>
<!-- waypoint loading node --> <!-- waypoint loading node -->
<!-- <group if="$(eval arg('machine_id') == 1)"> --> <!-- <group if="$(eval arg('machine_id') == 1)"> -->
...@@ -58,26 +61,23 @@ ...@@ -58,26 +61,23 @@
<node pkg="database_tools" type="sqlite_upload.py" name="sql_uploader"/> <node pkg="database_tools" type="sqlite_upload.py" name="sql_uploader"/>
<node name="image_handler" pkg="database_tools" type="image_handler.py"/> <node name="image_handler" pkg="database_tools" type="image_handler.py"/>
<!-- start pure data instance, along with publisher -->
<node name="puredataLaunch" pkg="puredata" type="puredataLaunch.bash" machine="$(arg machine_name)"/>
<node name="puredataPublisher" pkg="puredata" type="puredataPublisher.py" machine="$(arg machine_name)"/>
<!-- QUALISYS BULLSHIT --> <!-- QUALISYS BULLSHIT -->
<!-- qualisys-like gps reference --> <!-- qualisys-like gps reference move this to remote??? -->
<node name="qualisysSpoof" pkg="database_tools" type="qualisysSpoof.py"> <!-- <node name="qualisysSpoof" pkg="dji_osdk_ros" type="qualisysSpoofRemote.py" machine="$(arg machine_name)">
<rosparam command="load" param="anchorPoint"> [37.196941, -80.578335] </rosparam> <rosparam command="load" param="anchorPoint"> [37.227531, -80.406156] </rosparam>
</node> <rosparam command="load" param="angleOffset"> 0 </rosparam>
</node> -->
<!-- if doing position playback --> <!-- if doing position playback, should die if no qualisys -->
<node pkg="dji_osdk_ros" type="qualisysFeedback.py" name="qualisysTracking" output="screen" machine="$(arg machine_name)"> <node pkg="dji_osdk_ros" type="qualisysPublisher.py" name="qualisysPub" output="screen" machine="$(arg machine_name)">
<!-- <param name="trackName" type="string" value="$(arg machine_name)"/> --> <param name="trackName" type="string" value="Drone220110"/>
<param name="trackName" type="string" value="plathQual"/> <param name="qualisysName" type="string" value="feedback"/>
<param name="qualisysName" type="string" value="tracking"/>
</node> </node>
<!-- sound stuff -->
<!-- <arg name="device" default="front:CARD=Headset,DEV=0"/> -->
<!-- <remap from="robotsound" to="$(arg machine_name)/robotsound"/> -->
<!-- <node pkg="sound_play" type="soundplay_node.py" name="soundplay_node" machine="$(arg machine_name)">
<param name="device" value="$(arg device)"/>
</node> -->
</group> </group>
</launch> </launch>
#! /home/llh/anaconda3/bin/python
# may need to change that shebang for jetson
import rospy, sys, math, cv2, numpy as np, std_msgs.msg
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageViewer():
def __init__(self):
self.bridge = CvBridge()
self.subscriber = rospy.Subscriber("usb_camera/image_raw", Image, self.imageCallback)
self.params = None
self.image = None
def imageCallback(self, frame):
# self.params = self.getParams()
try:
self.image = self.bridge.imgmsg_to_cv2(frame, "bgr8")
except CvBridgeError as err:
rospy.loginfo("there was error!")
rospy.loginfo(err)
def main():
iv = ImageViewer()
rospy.init_node("imageViewer")
cv2.namedWindow("image window")
cv2.waitKey(200)
while not rospy.is_shutdown():
if iv.image is not None:
cv2.imshow("image window", iv.image)
cv2.waitKey(10)
cv2.destroyAllWindows()
if __name__ == "__main__":
main()
#! /home/llh/anaconda3/bin/python
import rospy
import sys
# from osc4py3.as_eventloop import *
# from osc4py3.as_allthreads import *
from osc4py3.as_comthreads import *
from osc4py3 import oscmethod as osm
from geometry_msgs.msg import Point
from std_msgs.msg import Float32
import netifaces as ni
# blah blah blah
# AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
class OSCTranslator():
def __init__(self):
self.positionPub = rospy.Publisher('target_position', Point, queue_size = 1)
self.headingPub = rospy.Publisher('target_heading', Float32, queue_size = 1)
rospy.init_node('puredata_publisher')
self.rate = rospy.Rate(20)
self.targetPosition = Point()
self.targetHeading = 0.0
rospy.loginfo("starting osc server")
# Make server channels to receive packets.
# get wifi interfaces ip
ip = ni.ifaddresses('wlp0s20f3')[ni.AF_INET][0]['addr']
rospy.loginfo("starting osc server on " + str(ip))
# osc_udp_server(ip, 3721, "aservername")
osc_udp_server('127.0.0.1', 3721, "aservername")
osc_method("/position", self.handlerfunctionflex, argscheme=osm.OSCARG_ADDRESS + osm.OSCARG_DATAUNPACK)
# osc_method("/sound/one", self.handlerfunctionflex, argscheme=osm.OSCARG_ADDRESS + osm.OSCARG_DATAUNPACK)
# osc_method("/master", self.handlerfunctionflex, argscheme=osm.OSCARG_ADDRESS + osm.OSCARG_DATAUNPACK)
def handlerfunctionflex(self, address, *args):
# Will receive message data unpacked in s, x, y
rospy.loginfo("from: " + address + ": " + str(args))
if (address == "/position"):
rospy.loginfo("publishing position...")
self.targetPosition.x = args[0]
self.targetPosition.y = args[1]
self.targetPosition.z = args[2]
self.positionPub.publish(self.targetPosition)
self.targetHeading = args[3]
self.headingPub.publish(self.targetHeading)
elif (address == "/sound/one"):
rospy.loginfo("publishing sound...")
elif (address == "/master"):
rospy.loginfo("publishing master vol...")
# pure data will handle sounds..?
pass
if __name__ == "__main__":
osc_startup()
oscer = OSCTranslator()
rospy.loginfo("starting osc process loop")
while not rospy.is_shutdown():
# rospy.loginfo("processing osc msgs...")
osc_process()
oscer.rate.sleep()
# rospy.spin()
osc_terminate()
...@@ -2,26 +2,26 @@ ...@@ -2,26 +2,26 @@
from tools import meters2lat_lon, lat_lon2meters, normalizeAngle, point_rotation from tools import meters2lat_lon, lat_lon2meters, normalizeAngle, point_rotation
import numpy as np import numpy as np
import rospy import rospy
import math
def generateWaypoints(): def generateWaypoints():
rospy.init_node("waypointGenerator") rospy.init_node("waypointGenerator")
anchorPoint = rospy.get_param("~anchorPoint") anchorPoint = rospy.get_param("~anchorPoint")
pathPoints = rospy.get_param("~pathPoints") pathPoints = rospy.get_param("~pathPoints")
baseWaypointAltitude = rospy.get_param("~altitude") pathType = rospy.get_param("~pathType")
droneNum = rospy.get_param("~droneNum") baseAltitude = rospy.get_param("~altitude")
angleOffset = rospy.get_param("~angleOffset") droneNum = int(rospy.get_param("~droneNum"))
spiralRadius = rospy.get_param("~spiralRadius")
spiralHeight = rospy.get_param("~spiralHeight")
spiralLoops = int(rospy.get_param("~spiralLoops"))
altitudeIncrement = rospy.get_param("~altitudeIncrement") # how much to separate drones on z axis
# waypointAltitudeIncrement = baseWaypointAltitude # increase altitude for each drone in team apMeters = lat_lon2meters(anchorPoint)
waypointAltitudeIncrement = 10 # increase altitude for each drone in team tempDict = {"waypoints" : {}, "positions" : {}, "numWaypoints" : 0, "numPositions" : 0}
waypointDict = {}
# decide if path is "preplanned" or not # path type if
if (len(pathPoints) != 0): if (pathType == "points" and len(pathPoints) != 0):
apMeters = lat_lon2meters(anchorPoint)
tempDict = {"waypoints" : {}, "positions" : {}, "numWaypoints" : 0, "numPositions" : 0}
waypointDict = {}
# define dictionary
numWaypoints = len(pathPoints)
numPositions = len(pathPoints)
for d in range(droneNum): for d in range(droneNum):
# rospy.loginfo("blah!") # rospy.loginfo("blah!")
...@@ -33,30 +33,27 @@ def generateWaypoints(): ...@@ -33,30 +33,27 @@ def generateWaypoints():
for i, pt in enumerate(pathPoints): for i, pt in enumerate(pathPoints):
# for i, offset in enumerate(waypointOffsets): # for i, offset in enumerate(waypointOffsets):
waypointLatLon = pt waypointLatLon = pt
waypointHeading = 0.0 heading = 0.0
# waypointHeading = normalizeAngle(45*i) # heading = normalizeAngle(45*i)
latLonPt = lat_lon2meters(pt) latLonPt = lat_lon2meters(pt)
positionXY = [latLonPt[0] - apMeters[0], latLonPt[1] - apMeters[1]] positionXY = [latLonPt[0] - apMeters[0], latLonPt[1] - apMeters[1]]
# waypoints # waypoints
waypointDict["robot_{}".format(d)]["waypoints"].update({"waypoint_{}".format(i) : [i, waypointLatLon[0], waypointLatLon[1], baseWaypointAltitude + d*waypointAltitudeIncrement, waypointHeading]}) waypointDict["robot_{}".format(d)]["waypoints"].update({"waypoint_{}".format(i) : [i, waypointLatLon[0], waypointLatLon[1], baseAltitude + d*altitudeIncrement, heading]})
# positions # positions
waypointDict["robot_{}".format(d)]["positions"].update({"position_{}".format(i) : [i, positionXY[0], positionXY[1], baseWaypointAltitude + d*waypointAltitudeIncrement, waypointHeading]}) waypointDict["robot_{}".format(d)]["positions"].update({"position_{}".format(i) : [i, positionXY[0], positionXY[1], baseAltitude + d*altitudeIncrement, heading]})
# do this betta # do this betta
waypointDict["robot_{}".format(d)]["numWaypoints"] = numWaypoints waypointDict["robot_{}".format(d)]["numWaypoints"] = len(pathPoints)
waypointDict["robot_{}".format(d)]["numPositions"] = numPositions waypointDict["robot_{}".format(d)]["numPositions"] = len(pathPoints)
# print(waypointDict)
rospy.set_param("/robot_list", waypointDict) elif (pathType == "squares"):
else:
# musical drones trajectory is convient test case, but general path is possible # musical drones trajectory is convient test case, but general path is possible
# ring sizes # ring sizes
big = 2.0 big = 10.0
med = 2.0 med = 5.0
sml = 2.0 sml = 2.0
apMeters = lat_lon2meters(anchorPoint)
waypointOffsets = [ waypointOffsets = [
[-big, -big], [-big, -big],
[big, -big], [big, -big],
...@@ -69,13 +66,6 @@ def generateWaypoints(): ...@@ -69,13 +66,6 @@ def generateWaypoints():
[sml, sml], [sml, sml],
[big, -big], [big, -big],
] ]
tempDict = {"waypoints" : {}, "positions" : {}, "numWaypoints" : 0, "numPositions" : 0}
waypointDict = {}
# define dictionary
numWaypoints = len(waypointOffsets)
numPositions = len(waypointOffsets) # TODO, add position list to parameters
# print(waypointDict)
for d in range(droneNum): for d in range(droneNum):
# rospy.loginfo("blah!") # rospy.loginfo("blah!")
...@@ -87,18 +77,48 @@ def generateWaypoints(): ...@@ -87,18 +77,48 @@ def generateWaypoints():
for i, offset in enumerate(waypointOffsets): for i, offset in enumerate(waypointOffsets):
waypointLatLon = meters2lat_lon([apMeters[0] + offset[0], apMeters[1] + offset[1]]) waypointLatLon = meters2lat_lon([apMeters[0] + offset[0], apMeters[1] + offset[1]])
waypointLatLonRev = meters2lat_lon([apMeters[0] - offset[0], apMeters[1] - offset[1]]) waypointLatLonRev = meters2lat_lon([apMeters[0] - offset[0], apMeters[1] - offset[1]])
waypointHeading = normalizeAngle(45*i) heading = normalizeAngle(45*i)
# waypoints
waypointDict["robot_{}".format(d)]["waypoints"].update({"waypoint_{}".format(i) : [i, waypointLatLon[0], waypointLatLon[1], baseAltitude + d*waypointAltitudeIncrement, heading]})
# positions
waypointDict["robot_{}".format(d)]["positions"].update({"position_{}".format(i) : [i, offset[0], offset[1], baseAltitude + d*waypointAltitudeIncrement, heading]})
# do this betta
waypointDict["robot_{}".format(d)]["numWaypoints"] = len(waypointOffsets)
waypointDict["robot_{}".format(d)]["numPositions"] = len(waypointOffsets)
elif (pathType == "spiral"):
# sprial path with heading pointing towards center of spiral
theta = 0.0
radians = np.pi*2.0*spiralLoops # total radians in spiral
loopPoints = 20 # 20 steps per single loop
totalPoints = loopPoints*spiralLoops
thetaStep = radians/totalPoints
heightStep = spiralHeight/totalPoints
height = 0.0
for d in range(droneNum):
waypointDict["robot_{}".format(d)] = {}
waypointDict["robot_{}".format(d)] = {}
waypointDict["robot_{}".format(d)]["waypoints"] = {}
waypointDict["robot_{}".format(d)]["positions"] = {}
# spiral loop
for i in range(totalPoints):
offset = [spiralRadius*math.cos(theta), spiralRadius*math.sin(theta)]
waypointLatLon = meters2lat_lon([apMeters[0] + offset[0], apMeters[1] + offset[1]])
heading = normalizeAngle(math.degrees(-theta - (np.pi/2.0)))
# waypoints # waypoints
waypointDict["robot_{}".format(d)]["waypoints"].update({"waypoint_{}".format(i) : [i, waypointLatLon[0], waypointLatLon[1], baseWaypointAltitude + d*waypointAltitudeIncrement, waypointHeading]}) waypointDict["robot_{}".format(d)]["waypoints"].update({"waypoint_{}".format(i) : [i, waypointLatLon[0], waypointLatLon[1], baseAltitude + height + d*altitudeIncrement, heading]})
# positions # positions
waypointDict["robot_{}".format(d)]["positions"].update({"position_{}".format(i) : [i, offset[0], offset[1], baseWaypointAltitude + d*waypointAltitudeIncrement, waypointHeading]}) waypointDict["robot_{}".format(d)]["positions"].update({"position_{}".format(i) : [i, offset[0], offset[1], baseAltitude + height + d*altitudeIncrement, heading]})
theta = theta + thetaStep
height = height + heightStep
# do this betta # do this betta
waypointDict["robot_{}".format(d)]["numWaypoints"] = numWaypoints waypointDict["robot_{}".format(d)]["numWaypoints"] = totalPoints
waypointDict["robot_{}".format(d)]["numPositions"] = numPositions waypointDict["robot_{}".format(d)]["numPositions"] = totalPoints
# print(waypointDict) rospy.set_param("/robot_list", waypointDict)
rospy.set_param("/robot_list", waypointDict)
return return
# print(waypointDict) # print(waypointDict)
......
cmake_minimum_required(VERSION 3.0.2)
project(dji_osdk_ros)
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
message_generation
roscpp
rospy
std_msgs
sensor_msgs
message_filters # for message_filter
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
add_message_files(
FILES
FCTimeInUTC.msg
JoystickParams.msg
GPSUTC.msg
Gimbal.msg
Waypoint.msg
WaypointList.msg
WaypointV2AircraftControlActuatorFlying.msg
WaypointV2AircraftControlActuatorRotateHeading.msg
WaypointV2AircraftControlActuator.msg
WaypointV2AssociateTrigger.msg
WaypointV2CameraActuatorFocalLengthParam.msg
WaypointV2CameraActuatorFocusParam.msg
WaypointV2CameraActuator.msg
WaypointV2Config.msg
WaypointV2GimbalActuatorRotationParam.msg
WaypointV2GimbalActuator.msg
WaypointV2InitSetting.msg
WaypointV2IntervalTrigger.msg
WaypointV2ReachpointTrigger.msg
WaypointV2SampleReachPointTrigger.msg
WaypointV2TrajectoryTrigger.msg
WaypointV2Action.msg
WaypointV2.msg
WaypointV2MissionEventPush.msg
WaypointV2MissionStatePush.msg
MobileData.msg
PayloadData.msg
MissionWaypointAction.msg
MissionWaypoint.msg
MissionWaypointTask.msg
MissionHotpointTask.msg
FlightAnomaly.msg
VOPosition.msg
BatteryState.msg
BatteryWholeInfo.msg
SmartBatteryState.msg
SmartBatteryDynamicInfo.msg
HMSPushInfo.msg
)
## Generate services in the 'srv' folder
add_service_files(
FILES
GetDroneType.srv
GetM300StereoParams.srv
FlightTaskControl.srv
SetJoystickMode.srv
JoystickAction.srv
ObtainControlAuthority.srv
KillSwitch.srv
EmergencyBrake.srv
GimbalAction.srv
CameraEV.srv
CameraShutterSpeed.srv
CameraAperture.srv
CameraISO.srv
CameraFocusPoint.srv
CameraTapZoomPoint.srv
CameraSetZoomPara.srv
CameraZoomCtrl.srv
CameraStartShootSinglePhoto.srv
CameraStartShootBurstPhoto.srv
CameraStartShootAEBPhoto.srv
CameraStartShootIntervalPhoto.srv
CameraStopShootPhoto.srv
CameraRecordVideoAction.srv
GetWholeBatteryInfo.srv
GetSingleBatteryDynamicInfo.srv
MFIO.srv
SetGoHomeAltitude.srv
GetGoHomeAltitude.srv
SetCurrentAircraftLocAsHomePoint.srv
SetHomePoint.srv
SetupCameraH264.srv
SetAvoidEnable.srv
GetAvoidEnable.srv
InitWaypointV2Setting.srv
UploadWaypointV2Mission.srv
UploadWaypointV2Action.srv
DownloadWaypointV2Mission.srv
StartWaypointV2Mission.srv
StopWaypointV2Mission.srv
PauseWaypointV2Mission.srv
ResumeWaypointV2Mission.srv
GenerateWaypointV2Action.srv
SetGlobalCruisespeed.srv
GetGlobalCruisespeed.srv
GetHMSData.srv
SubscribeWaypointV2Event.srv
SubscribeWaypointV2State.srv
Activation.srv
CameraAction.srv
DroneTaskControl.srv
SDKControlAuthority.srv
SetLocalPosRef.srv
MFIOConfig.srv
MFIOSetValue.srv
DroneArmControl.srv
MissionStatus.srv
MissionWpAction.srv
MissionHpAction.srv
MissionWpUpload.srv
MissionWpSetSpeed.srv
MissionWpGetSpeed.srv
MissionWpGetInfo.srv
MissionHpUpload.srv
MissionHpGetInfo.srv
MissionHpUpdateYawRate.srv
MissionHpUpdateRadius.srv
MissionHpResetYaw.srv
SendMobileData.srv
SendPayloadData.srv
SetHardSync.srv
QueryDroneVersion.srv
Stereo240pSubscription.srv
StereoVGASubscription.srv
StereoDepthSubscription.srv
SetupCameraStream.srv
Overwatch.srv
)
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
geometry_msgs
std_msgs # Or other packages containing msgs
sensor_msgs
)
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed
## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES dji_osdk_ros
# CATKIN_DEPENDS geometry_msgs roscpp rospy sensor_msgs std_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/dji_osdk_ros.cpp
# )
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/dji_osdk_ros_node.cpp)
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# catkin_install_python(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_dji_osdk_ros.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
uint8 voltageNotSafety # Generally caused by low temperature, the battery has electricity,
# but the battery voltage is too low.
uint8 veryLowVoltageAlarm
uint8 LowVoltageAlarm
uint8 seriousLowCapacityAlarm
uint8 LowCapacityAlarm
\ No newline at end of file
uint16 remainFlyTime # remain fly time(s)
uint16 goHomeNeedTime # Time required for the gohome flight (s)
uint16 landNeedTime # Time required for the land flight (s).max value:100*/
uint16 goHomeNeedCapacity # Capacity required for the gohome flight (%).max value:100*/
uint16 landNeedCapacity # Capacity required for the land flight (%).max value:100*/
float32 safeFlyRadius # Safe flight area radius (m)*/
float32 capacityConsumeSpeed # (mAh/sec)*/
BatteryState batteryState
uint8 goHomeCountDownState # Countdown status of smart battery gohome
# 0/2:not in gohome state
# 1 :in gohome state
#
uint8 gohomeCountDownvalue # uint:s.max value:10
uint16 voltage # mv
uint8 batteryCapacityPercentage # uint:%.max value:100
uint8 lowBatteryAlarmThreshold
uint8 lowBatteryAlarmEnable
uint8 seriousLowBatteryAlarmThreshold
uint8 seriousLowBatteryAlarmEnable
\ No newline at end of file
# the time stamp of getting this data in the ROS system
time stamp
# the time stamp in FC
uint32 fc_timestamp_us
uint32 fc_utc_yymmdd
uint32 fc_utc_hhmmss
# Here is an example how to use FlightAnomaly msg:
#
# void flightAnomalyCallback(const dji_osdk_ros::FlightAnomaly::ConstPtr & msg)
# {
# uint32_t flightAnomalyData = msg->data;
# if(flightAnomalyData)
# {
# ROS_INFO("Flight Anomaly Reported by Flight Controller. Here are details:");
# if(flightAnomalyData && dji_osdk_ros::FlightAnomaly::COMPASS_INSTALLATION_ERROR)
# {
# ROS_INFO("COMPASS_INSTALLATION_ERROR");
# }
#
# if(flightAnomalyData && dji_osdk_ros::FlightAnomaly::IMU_INSTALLATION_ERROR)
# {
# ROS_INFO("IMU_INSTALLATION_ERROR");
# }
#
# // etc...
# }
# }
#
#
# constants for anomaly details
uint32 IMPACT_IN_AIR = 1 #
uint32 RANDOM_FLY = 2 #
uint32 VERTICAL_CONTROL_FAIL = 4 #
uint32 HORIZONTAL_CONTROL_FAIL = 8 #
uint32 YAW_CONTROL_FAIL = 16 #
uint32 AIRCRAFT_IS_FALLING = 32 #
uint32 STRONG_WIND_LEVEL1 = 64 #
uint32 STRONG_WIND_LEVEL2 = 128 #
uint32 COMPASS_INSTALLATION_ERROR = 256 #
uint32 IMU_INSTALLATION_ERROR = 512 #
uint32 ESC_TEMPERATURE_HIGH = 1024 #
uint32 ESC_DISCONNECTED = 2048 #
uint32 GPS_YAW_ERROR = 4096 #
#
uint32 data
# the time stamp of getting this data in the ROS system
time stamp
# the time stamp from GPS/RTK
string UTCTimeData
Header header
# ts is the time it takes to achieve the desired angle,
# so the shorter the time, the faster the gimbal rotates.
int32 ts # sec
# Mode is 1 byte size:
# Bit #: | Set to 0: | Set to 1:
# ----------- | ------------------------------------- | -------------------------------------
# bit 0 | Incremental control, | Absolute control,
# | the angle reference is the | the angle reference is
# | current Gimbal location | related to configuration in DJI Go App
# bit 1 | Gimbal will follow the command in Yaw | Gimbal will maintain position in Yaw
# bit 2 | Roll invalid bit, the same as bit[1] | Roll invalid bit, the same as bit[1]
# bit 3 |Pitch invalid bit, the same as bit[1] | Pitch invalid bit, the same as bit[1]
# bit [4:7] | bit [4:7]: reserved, set to be 0 |
uint8 mode
float32 yaw # rads
float32 pitch # rads
float32 roll # rads
uint32 alarmID #/*! error code*/
uint8 sensorIndex #/*! fault sensor's index*/
uint8 reportLevel #/*! fault level ,0-4,0 is no error,4 is highest*/
\ No newline at end of file
float32 x # Control with respect to the x axis of the
# DJI::OSDK::Control::HorizontalCoordinate.
float32 y # Control with respect to the y axis of the
# DJI::OSDK::Control::HorizontalCoordinate.
float32 z # Control with respect to the z axis, up is positive.
float32 yaw #Yaw position/velocity control w.r.t. the ground frame.
\ No newline at end of file
float64 latitude # degree
float64 longitude # degree
float64 altitude # meter
float64 radius # meter
float32 angular_speed #deg/s
uint8 is_clockwise
uint8 start_point
uint8 yaw_mode
float64 latitude # degree
float64 longitude # degree
float32 altitude # relative altitude from takeoff point
float32 damping_distance # Bend length (effective coordinated turn mode only)
int16 target_yaw # Yaw (degree)
int16 target_gimbal_pitch # Gimbal pitch
uint8 turn_mode # 0: clockwise, 1: counter-clockwise
uint8 has_action # 0: no, 1: yes
uint16 action_time_limit
MissionWaypointAction waypoint_action
# action_repeat
# lower 4 bit: Total number of actions
# hight 4 bit: Total running times
uint8 action_repeat
uint8[16] command_list
uint16[16] command_parameter
# constant for action_on_finish
uint8 FINISH_NO_ACTION = 0 # no action
uint8 FINISH_RETURN_TO_HOME = 1 # return to home
uint8 FINISH_AUTO_LANDING = 2 # auto landing
uint8 FINISH_RETURN_TO_POINT = 3 # return to point 0
uint8 FINISH_NO_EXIT = 4 # infinite mode, no exit
# constant for yaw_mode
uint8 YAW_MODE_AUTO = 0 # auto mode (point to next waypoint)
uint8 YAW_MODE_LOCK = 1 # lock as an initial value
uint8 YAW_MODE_RC = 2 # controlled by RC
uint8 YAW_MODE_WAYPOINT = 3 # use waypoint's yaw(tgt_yaw)
# constant for trace_mode
uint8 TRACE_POINT = 0 # point to point, after reaching the target waypoint hover, complete waypt action (if any), then fly to the next waypt
uint8 TRACE_COORDINATED = 1 # 1: Coordinated turn mode, smooth transition between waypts, no waypts task
# constants for action_on_rc_lost
uint8 ACTION_FREE = 0 # exit waypoint and failsafe
uint8 ACTION_AUTO = 1 # continue the waypoint
# constants for gimbal_pitch_mode
uint8 GIMBAL_PITCH_FREE = 0 # free mode, no control on gimbal
uint8 GIMBAL_PITCH_AUTO = 1 # auto mode, Smooth transition between waypoints on gimbal
float32 velocity_range # Maximum speed joystick input(2~15m)
float32 idle_velocity # Cruising Speed (without joystick input, no more than vel_cmd_range)
uint8 action_on_finish # See constants above for possible actions
uint8 mission_exec_times # 1: once ; 2: twice
uint8 yaw_mode # see constants above for possible yaw modes
uint8 trace_mode # see constants above for possible trace modes
uint8 action_on_rc_lost # see constants above for possible actions
uint8 gimbal_pitch_mode # see constants above for pissible gimbal modes
MissionWaypoint[] mission_waypoint # a vector of waypoints
uint8[] data
\ No newline at end of file
uint8[] data
\ No newline at end of file
uint8 batteryIndex
int32 currentVoltage # uint:mV
int32 currentElectric # uint:mA
uint32 fullCapacity # uint:mAh
uint32 remainedCapacity # uint:mAh
int16 batteryTemperature # uint:0.1℃
uint8 cellCount
uint8 batteryCapacityPercent # uint:%
SmartBatteryState batteryState
uint8 SOP # Relative power percentage
\ No newline at end of file
uint8 cellBreak # 0:normal;other:Undervoltage core index(0x01-0x1F)
uint8 selfCheckError # enum-type: DJISmartBatterySelfCheck
uint8 batteryClosedReason # enum-type: DJI_BETTERY_CLOSED_REASON
uint8 batSOHState # enum-type: DJISmartBatterySohState*/
uint8 maxCycleLimit # APP:cycle_limit*10*/
uint8 batteryCommunicationAbnormal
uint8 hasCellBreak
uint8 heatState # enum-type: DJISmartBatteryHeatState
\ No newline at end of file
Header header
float32 x
float32 y
float32 z
uint8 xHealth
uint8 yHealth
uint8 zHealth
\ No newline at end of file
float64 latitude # in degree
float64 longitude # in degree
float32 altitude
int16 heading #heading is in [-180,180]
uint16 staytime # in second
Waypoint[] waypoint_list
# The struct represents a target point in the waypoint mission. For a waypoint
#constant for flightpathMode
uint8 DJIWaypointV2FlightPathModeGoToPointAlongACurve = 0 #In the mission, the aircraft will go to the waypoint along a curve and fly past the waypoint.
uint8 DJIWaypointV2FlightPathModeGoToPointAlongACurveAndStop = 1 #In the mission, the aircraft will go to the waypoint along a curve and stop at the waypoint.
uint8 DJIWaypointV2FlightPathModeGoToPointInAStraightLineAndStop = 2 #In the mission, the aircraft will go to the waypoint along a straight line and stop at the waypoint.
uint8 DJIWaypointV2FlightPathModeCoordinateTurn = 3 #In the mission, the aircraft will fly from the previous waypoint to the next waypoint along a smooth curve without stopping at this waypoint.
#the next in a curved motion, adhering to the ``DJIWaypointV2_dampingDistance``, which is
#set in ``DJIWaypointV2``.
uint8 DJIWaypointV2FlightPathModeGoToFirstPointAlongAStraightLine = 4 # In the mission, the aircraft will go to the first waypoint along a straight line.
# This is only valid for the first waypoint.
uint8 DJIWaypointV2FlightPathModeStraightOut = 5 # Straight exit the Last waypoint, Only valid for last waypoint.
uint8 DJIWaypointV2FlightPathModeUnknown = 255 # Unknown
#constant for headMode
uint8 DJIWaypointV2HeadingModeAuto = 0 # Aircraft's heading will always be in the direction of flight.
uint8 DJIWaypointV2HeadingFixed = 1 # Aircraft's heading will be set to the heading when reaching the first waypoint.
# Before reaching the first waypoint, the aircraft's heading can be controlled by
# the remote controller. When the aircraft reaches the first waypoint, its
# heading will be fixed.
uint8 DJIWaypointV2HeadingManual = 2 # The aircraft's heading in the mission can be controlled by the remote controller.
uint8 DJIWaypointV2HeadingWaypointCustom = 3 # In the mission, the aircraft's heading will change dynamically and adapt to the heading set at the next waypoint.
# See ``DJIWaypointV2_heading`` to preset the heading.
uint8 DJIWaypointV2HeadingTowardPointOfInterest = 4 # Aircraft's heading will always toward point of interest.
# using ``DJIWaypointV2_pointOfInterest`` setting point of interest coordiate and ``DJIWaypointV2_pointOfInterestAltitude``
# setting point of interset altitute.
uint8 DJIWaypointV2HeadingGimbalYawFollow = 5 # The aircraft's heading rotate simultaneously with its gimbal's yaw.
uint8 DJIWaypointV2HeadingUnknown = 255 # Unknown.
#constant for turnMode
uint8 DJIWaypointV2TurnModeClockwise = 0 # The aircraft's heading rotates clockwise.
uint8 DJIWaypointV2TurnModeCounterClockwise = 1 # The aircraft's heading rotates counterclockwise.
uint8 DJIWaypointV2TurnModeUnknown = 255 # Changes the heading of the aircraft by rotating the aircraft anti-clockwise.
# mission, a flight route consists of multiple `WaypointV2` objects.
float64 longitude # waypoint position relative to WayPointV2InitSettings's reference point.unit: m
float64 latitude
float32 relativeHeight # relative to takeoff height
uint8 waypointType # Waypoint flight path mode
uint8 headingMode # Represents current aircraft's heading mode on current waypoint.
WaypointV2Config config # Represents current waypoint's speed config.
uint16 dampingDistance
float32 heading # The heading to which the aircraft will rotate by the time it reaches the
# waypoint. The aircraft heading will gradually change between two waypoints with
# different headings if the waypoint mission's `headingMode` is set to
# 'DJIWaypointV2_DJIWaypointV2HeadingMode_WaypointCustom`. A heading has a range of
# [-180, 180] degrees, where 0 represents True North.
uint8 turnMode # Determines whether the aircraft will turn clockwise or anticlockwise when
# changing its heading.
# Property is used when ``DJIWaypointV2_headingMode`` is
# ``DJIWaypointV2_DJIWaypointV2HeadingMode_TowardPointOfInterest``.
# Aircraft will always be heading to point while executing mission. Default is
# "kCLLocationCoordinate2DInvalid".
float32 positionX # X distance to reference point, North is positive
float32 positionY # Y distance to reference point, East is positive
float32 positionZ # Z distance to reference point, UP is positive
# While the aircraft is travelling between waypoints, you can offset its speed by
# using the throttle joystick on the remote controller. "maxFlightSpeed" is this
# offset when the joystick is pushed to maximum deflection. For example, If
# maxFlightSpeed is 10 m/s, then pushing the throttle joystick all the way up will
# add 10 m/s to the aircraft speed, while pushing down will subtract 10 m/s from
# the aircraft speed. If the remote controller stick is not at maximum deflection,
# then the offset speed will be interpolated between "[0, maxFlightSpeed]"" with a
# resolution of 1000 steps. If the offset speed is negative, then the aircraft
# will fly backwards to previous waypoints. When it reaches the first waypoint, it
# will then hover in place until a positive speed is applied. "maxFlightSpeed" has
# a range of [2,15] m/s.
float32 maxFlightSpeed
# The base automatic speed of the aircraft as it moves between waypoints with
# range [-15, 15] m/s. The aircraft's actual speed is a combination of the base
# automatic speed, and the speed control given by the throttle joystick on the
# remote controller. If "autoFlightSpeed >0": Actual speed is "autoFlightSpeed" +
# Joystick Speed (with combined max of "maxFlightSpeed") If "autoFlightSpeed =0":
# Actual speed is controlled only by the remote controller joystick. If
# autoFlightSpeed <0" and the aircraft is at the first waypoint, the aircraft
# will hover in place until the speed is made positive by the remote controller
# joystick. In flight controller firmware 3.2.10.0 or above, different speeds
# between individual waypoints can also be set in waypoint objects which will
# overwrite "autoFlightSpeed".
float32 autoFlightSpeed
\ No newline at end of file
# This class represents an action for ``DJIWaypointV2Mission``. It
# determines how action is performed when a waypoint mission is executed.
# The action will be triggered when action associated executes.
# The parameters should be defined by ``DJIWaypointV2Action_DJIWaypointV2AssociateTriggerParam``.
uint8 DJIWaypointV2ActionTriggerTypeActionAssociated = 2
# The action will be triggered when the aircraft flies from one waypoint to the next.
# The parameters should be defined by ``DJIWaypointV2Action_DJIWaypointV2TrajectoryTriggerParam``.
uint8 DJIWaypointV2ActionTriggerTypeTrajectory = 3
# The action will be triggered when the aircraft flies between two waypoints
# The parameters should be defined by ``DJIWaypointV2Action_DJIWaypointV2IntervalTriggerParam``.
uint8 DJIWaypointV2ActionTriggerTypeInterval = 4
uint8 DJIWaypointV2ActionTriggerTypeSampleReachPoint = 5
# Unknown
uint8 DJIWaypointV2ActionTriggerTypeUnknown = 255
#contant for waypointV2ActuatorTriggerType
# The action will be executed by the camera.
# The parameters should be defined by ``DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam``.
uint8 DJIWaypointV2ActionActuatorTypeCamera = 1
# The action will be executed by the gimbal.
# The parameters should be defined by ``DJIWaypointV2Action_DJIWaypointV2GimbalActuatorParam``.
uint8 DJIWaypointV2ActionActuatorTypeGimbal = 2
# The action will executes by control aircraft.
# The parameters should be setting by ``DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam``.
uint8 DJIWaypointV2ActionActuatorTypeAircraftControl = 4
# Unknown actuator type.
uint8 DJIWaypointV2ActionActuatorTypeUnknown = 255
uint16 actionId # The ID of Action.
uint8 waypointV2ActionTriggerType
uint8 waypointV2ACtionActuatorType
# The trigger of action.You can only choose one to config
WaypointV2AssociateTrigger waypointV2AssociateTrigger
WaypointV2IntervalTrigger waypointV2IntervalTrigger
WaypointV2TrajectoryTrigger waypointV2TrajectoryTrigger
WaypointV2SampleReachPointTrigger waypointV2SampleReachPointTrigger
# The actuator of action.You can only choose one to config
WaypointV2CameraActuator waypointV2CameraActuator
WaypointV2GimbalActuator waypointV2GimbalActuator
WaypointV2AircraftControlActuator waypointV2AircraftControlActuator
\ No newline at end of file
# Parameters for aircraft control actuator. It is valid only when the
# ``DJIWaypointV2Action_DJIWaypointV2Actuator_type`` is
# ``DJIWaypointV2MissionV2_DJIWaypointV2ActionActuatorType_AircraftControl``.
#contant for DJIWaypointV2ActionActuatorAircraftControlOperationType
# Rotates the aircraft's yaw.
uint8 DJIWaypointV2ActionActuatorAircraftControlOperationTypeRotateYaw = 1
# Keeps the aircraft stop flying or start flying.
uint8 DJIWaypointV2ActionActuatorAircraftControlOperationTypeFlyingControl = 2
# Unknown
uint8 DJIWaypointV2ActionActuatorAircraftControlOperationTypeUnknown = 255
uint8 actuatorIndex # The index of actuator. It is valid when the diagnostics is related
# to camera or gimbal and the connected product has multiple gimbals and cameras.
uint16 DJIWaypointV2ActionActuatorAircraftControlOperationType
WaypointV2AircraftControlActuatorFlying waypointV2AircraftControlActuatorFlying
WaypointV2AircraftControlActuatorRotateHeading waypointV2AircraftControlActuatorRotateHeading
\ No newline at end of file
# This class defines if the aircraft starts or stops the flight.s.
uint8 isStartFlying # Determines the aircraft start flying or stop flying.
# ``TRUE`` for the aircraft to start flying.
\ No newline at end of file
# This class defines how the aircraft rotates on the yaw axis.
uint8 isRelative # Determines the aircraft rotate heading relative.
# if ``TRUE``, when the aircraft is rotating, relative to the current angle.
float32 yaw # Determines the direction how aircraft changes its heading.
\ No newline at end of file
#contant for actionAssociatedType
uint8 DJIWaypointV2TriggerAssociatedTimingTypeSimultaneously = 1 # The trigger starts simultaneously with the trigger that is associated.
uint8 DJIWaypointV2TriggerAssociatedTimingTypeAfterFinised = 2 # The trigger starts after the trigger associated has finished.
uint8 DJIWaypointV2TriggerAssociatedTimingTypeUnknown = 255 # Unkown timing type.
uint8 actionAssociatedType # The type of assciate trigger.
uint8 waitingTime # Waiting time in seconds after ActionTrigger starts.
uint16 actionIdAssociated # Associated action ID.
\ No newline at end of file
# This determines how the camera will be performed when a waypoint mission is executing.
#constant for DJIWaypointV2ActionActuatorCameraOperationType
# Starts to shoot a photo.
uint16 DJIWaypointV2ActionActuatorCameraOperationTypeTakePhoto = 1
# Starts to record a video.
uint16 DJIWaypointV2ActionActuatorCameraOperationTypeStartRecordVideo = 2
# Stops to record a video.
uint16 DJIWaypointV2ActionActuatorCameraOperationTypeStopRecordVideo = 3
# Starts focus.
uint16 DJIWaypointV2ActionActuatorCameraOperationTypeFocus = 4
# Starts focal lenth. Only support those support flocal lenth cameras.
uint16 DJIWaypointV2ActionActuatorCameraOperationTypeFocalLength = 5
uint16 actuatorIndex # The index of actuator. It is valid when the diagnostics is related
# to camera or gimbal and the connected product has multiple gimbals and cameras.
uint16 DJIWaypointV2ActionActuatorCameraOperationType
# you can only choose one to config.
WaypointV2CameraActuatorFocusParam focusParam # The parameters for camera focus operation. It is valid only when
# ``DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam_operationType`` is
# ``DJIWaypointV2MissionV2_DJIWaypointV2ActionActuatorCameraOperationType_Focus``
WaypointV2CameraActuatorFocalLengthParam zoomParam # The parameters for camera focus length operation. It is valid only when
# ``DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam_operationType`` is
# ``DJIWaypointV2MissionV2_DJIWaypointV2ActionActuatorCameraOperationType_FocalLength``
\ No newline at end of file
# This class defines a camera focal length operation for ``DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam``.
# Focal length of zoom lens. Valid range is [``DJICamera_DJICameraOpticalZoomSpec_minFocalLength``,
# ``DJICamera_DJICameraOpticalZoomSpec_minFocalLength``] and must be a multiple of
# ``DJICamera_DJICameraOpticalZoomSpec_focalLengthStep``.
# Only support by those camera ``DJICamera_CameraSettings_isOpticalZoomSupported`` return ``TRUE``.
uint16 focalLength
uint8 retryTimes = 1
\ No newline at end of file
# This class defines a camera focus operation for ``DJIWaypointV2Action_DJIWaypointV2CameraActuatorParam``.
# The lens focus target point. When the focus mode is auto, the target point
# is the focal point. When the focus mode is manual, the target point is the zoom
# out area if the focus assistant is enabled for the manual mode.
# The range for x and y is from 0.0 to 1.0. The point [0.0, 0.0] represents the top-left angle of the screen.
float32 x # x axis focus point value.range: [0,1]
float32 y # y axis focus point value.range: [0,1]
uint8 regionType #focus type:0:point focus,1:rectangle focus
float32 width #Normalized focus area width(0,1)
float32 height # Normalized focus area height(0,1)
uint8 retryTimes = 1
\ No newline at end of file
# Represents current waypoint's speed config.
# 0: set local waypoint's cruise speed,
# 1: unset global waypoint's cruise speed*/
uint8 useLocalCruiseVel
# 0: set local waypoint's max speed,
# 1: unset global waypoint's max speed*/
uint8 useLocalMaxVel
\ No newline at end of file
# gimbal actuator will be performed when a waypoint mission is executed.
#constant for DJIWaypointV2ActionActuatorGimbalOperationType
# Rotates the gimbal. Only valid when the trigger type is
# ``DJIWaypointV2MissionV2_DJIWaypointV2TriggerAssociatedTimingType_ReachPoint``.
uint8 DJIWaypointV2ActionActuatorGimbalOperationTypeRotateGimbal = 1
# Unknown
uint8 DJIWaypointV2ActionActuatorGimbalOperationTypeUnknown = 255
uint8 DJIWaypointV2ActionActuatorGimbalOperationType
uint16 actuatorIndex # The index of actuator. It is valid when the diagnostics is related
# to camera or gimbal and the connected product has multiple gimbals and cameras.
WaypointV2GimbalActuatorRotationParam waypointV2GimbalActuatorRotationParam # The operation type of gimbal actuator.
\ No newline at end of file
int16 x # gimbal roll angle, unit: 0.1 deg,range:[-3600, 3600]*/
int16 y # gimbal pitch angle, unit: 0.1 deg,range:[-3600, 3600]*/
int16 z # gimbal yaw angle, unit: 0.1 deg,range:[-3600, 3600]*/
uint8 ctrl_mode # 0: absolute position control, 1:relative position control*/
uint8 rollCmdIgnore # 0: roll command normal, 1: roll command ignore*/
uint8 pitchCmdIgnore# 0: pitch command normal, 1: pitch command ignore*/
uint8 yawCmdIgnore # 0: yaw command normal, 1: yaw command ignore*/
uint8 absYawModeRef # 0: absoluate rotate yaw relative to aircraft,
# 1: absoluate rotate yaw relative to North*/
uint8 duationTime # 0: rotate time,unit:0.1s, range[1,255]*/
\ No newline at end of file
# @brief Waypoint V2 Mission Initialization settings
# @details This is one of the few structs in the OSDK codebase that
# is used in both a sending and a receiving API.
#constant for finishedAction
uint8 DJIWaypointV2MissionFinishedNoAction = 0 # No further action will be taken.
# The aircraft can be controlled by the remote controller.
uint8 DJIWaypointV2MissionFinishedGoHome = 1 # Goes home when the mission is finished. The aircraft will
# land directly if it is within 20 meters away from the home point.
uint8 DJIWaypointV2MissionFinishedAutoLanding = 2 # The aircraft will land automatically at the last waypoint.
uint8 DJIWaypointV2MissionFinishedGoToFirstWaypoint = 3 # The aircraft will go back to the first waypoint and hover.
uint8 DJIWaypointV2MissionFinishedContinueUntilStop = 4 # When the aircraft reaches its final waypoint, it will hover without ending the
# mission. The joystick can still be used to pull the aircraft back along its
# previous waypoints. The only way this mission can end is if stopMission is
# called
#constant for gotoFirstWaypintMode
uint8 DJIWaypointV2MissionGotoFirstWaypointModeSafely = 0 # Go to the waypoint safely. The aircraft will rise to the same altitude of the
# waypoint if the current altitude is lower then the waypoint altitude. It then
# goes to the waypoint coordinate from the current altitude, and proceeds to the
# altitude of the waypoint.
uint8 DJIWaypointV2MissionGotoFirstWaypointModePointToPoint = 1 # Go to the waypoint from the current aircraft point to the waypoint directly.
uint32 missionID # The Mission ID. Use to distinguish different mission
uint16 missTotalLen # The Mission waypoint total length, could not exceed 65535
uint8 repeatTimes # Mission execution can be repeated more than once. A value of 0 means the mission
# only executes once, and does not repeat. A value of 1 means the mission will
# execute a total of two times.
uint8 finishedAction # Action the aircraft will take when the waypoint mission is complete.
# While the aircraft is travelling between waypoints, you can offset its speed by
# using the throttle joystick on the remote controller. `maxFlightSpeed` is this
# offset when the joystick is pushed to maximum deflection. For example, If
# maxFlightSpeed is 10 m/s, then pushing the throttle joystick all the way up
# will add 10 m/s to the aircraft speed, while pushing down will subtract 10 m/s
# from the aircraft speed. If the remote controller stick is not at maximum
# deflection, then the offset speed will be interpolated between [0,
# `maxFlightSpeed`] with a resolution of 1000 steps. If the offset speed is
# negative, then the aircraft will fly backwards to previous waypoints. When it
# reaches the first waypoint, it will then hover in place until a positive speed
# is applied. `maxFlightSpeed` has a range of [2,15] m/s.
# unit: m/s
float32 maxFlightSpeed
# The base automatic speed of the aircraft as it moves between waypoints with
# range [-15, 15] m/s. The aircraft's actual speed is a combination of the base
# automatic speed, and the speed control given by the throttle joystick on the
# remote controller. If `autoFlightSpeed` >0: Actual speed is `autoFlightSpeed` +
# Joystick Speed (with combined max of `maxFlightSpeed`) If `autoFlightSpeed` =0:
# Actual speed is controlled only by the remote controller joystick. If
# `autoFlightSpeed` <0 and the aircraft is at the first waypoint, the aircraft
# will hover in place until the speed is made positive by the remote controller
# joystick.
# unit: m/s
float32 autoFlightSpeed
uint8 exitMissionOnRCSignalLost # Determines whether the mission should stop when connection between the aircraft
# and remote controller is lost. Default is `NO`.
uint8 gotoFirstWaypointMode # Defines how the aircraft will go to the first waypoint from its current
# position. Default is ``DJIWaypointV2MissionV2_DJIWaypointV2MissionGotoWaypointMode_Safely``.
WaypointV2[] mission
\ No newline at end of file
#constant for actionIntervalType
uint8 DJIWaypointV2ActionIntervalTypeTime = 1 # The action will be repeated after a particular period of time.
uint8 DJIWaypointV2ActionIntervalTypeDistance = 2 # The action will be repeated after a particular distance.
uint8 DJIWaypointV2ActionIntervalTypeUnknown = 255 # Unknown action trigger type.
uint16 startIndex # It determines the index of the waypoint at which the trigger starts.
# If the ``DJIWaypointV2Action_DJIWaypointV2IntervalTriggerParam_actionIntervalType``
# is ``DJIWaypointV2MissionV2_DJIWaypointV2TriggerAssociatedTimingType_Time``
# The time interval in seconds when two action are executed as the aircraft moves
# from the current waypoint to the next waypoint.
# If the ``DJIWaypointV2Action_DJIWaypointV2IntervalTriggerParam_actionIntervalType`` is
# ``DJIWaypointV2MissionV2_DJIWaypointV2TriggerAssociatedTimingType_Distance``
# The distance interval in meters when two action are executed as the aircraft moves
# from the current waypoint to the next waypoint.
uint16 interval
uint8 actionIntervalType # The type of interval trigger.
# See ``DJIWaypointV2MissionV2_DJIWaypointV2ActionIntervalType``.
\ No newline at end of file
uint8 event
uint32 FCTimestamp
#ID:0x01
uint8 interruptReason #0x00:rc triggered interrupt
#ID:0x02
uint8 recoverProcess #0x00:finished pause recover
#ID:0x03
uint8 finishReason #0x00:finished normally; 0x10:External user trigger ended successfully
#ID:0x10
uint16 waypointIndex
#ID:0x11
uint8 currentMissionExecNum
uint8 finishedAllExecNum #0:not finished; 1:finished all exec num
\ No newline at end of file
int8 commonDataVersion
uint16 commonDataLen
uint16 curWaypointIndex
uint8 state #0x0:ground station not start. 0x1:mission prepared. 0x2:enter mission.
#0x3:execute flying route mission.
#0x4:pause state. 0x5:enter mission after ending pause.
#0x6:exit mission.
uint16 velocity #uint:0.01m/s
\ No newline at end of file
# It describes an action will be triggered when the aircraft reach the certain waypoint.
uint16 startIndex # It determines the index of the waypoint at which the action will be triggered.
uint16 endIndex
uint16 intervalWPNum
uint16 waypointCountToTerminate # It determines the waypoint count till the action triggered stops.
\ No newline at end of file
uint16 waypointIndex # It determines the index of the waypoint at which the action will be triggered.
uint16 terminateNum
# This class represents a trajectory trigger action when should be trigger.
uint16 startIndex # It determines the index of the waypoint at which the trigger starts.
uint16 endIndex # It determines the waypoint when the trigger stops.
<?xml version="1.0"?>
<package format="2">
<name>dji_osdk_ros</name>
<version>0.0.0</version>
<description>The dji_osdk_ros package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="llh@todo.todo">llh</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/dji_msgs</url> -->
<!-- Author tags are optional, multiple are allowed, one per tag -->
<!-- Authors do not have to be maintainers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
<!-- The *depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
<!-- <depend>roscpp</depend> -->
<!-- Note that this is equivalent to the following: -->
<!-- <build_depend>roscpp</build_depend> -->
<!-- <exec_depend>roscpp</exec_depend> -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use build_export_depend for packages you need in order to build against this package: -->
<!-- <build_export_depend>message_generation</build_export_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use exec_depend for packages you need at runtime: -->
<!-- <exec_depend>message_runtime</exec_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<!-- Use doc_depend for packages you need only for building documentation: -->
<!-- <doc_depend>doxygen</doc_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>geometry_msgs</build_export_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>sensor_msgs</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
\ No newline at end of file
#constant for camera_action
uint8 CAMERA_ACTION_TAKE_PICTURE = 0
uint8 CAMERA_ACTION_START_RECORD = 1
uint8 CAMERA_ACTION_STOP_RECORD = 2
#request
uint8 camera_action # see constants above for possible camera_actions
---
bool result
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 exposure_mode #see enum class ExposureMode in common_type.h
uint16 aperture #see enum class Aperture in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 exposure_mode #see enum class ExposureMode in common_type.h
uint8 exposure_compensation #see enum class ExposureCompensation in common_type.h
---
#reponse
bool result
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
float32 x #range from 0~1, top left corner is origin point
float32 y #range from 0~1, top left corner is origin point
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 exposure_mode #see enum class ExposureMode in common_type.h
uint8 iso_data #see enum class ISO in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 start_stop
uint8 payload_index #see enum class PayloadIndex in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
float32 factor
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 exposure_mode #see enum class ExposureMode in common_type.h
uint8 shutter_speed #see enum class ShutterSpeed in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 photo_aeb_count #see enum class PhotoAEBCount in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 photo_burst_count #see enum class PhotoBurstCount in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 photo_num_conticap # 0:reserve 1~254:number 255:keep capturing till stop
int16 time_interval #/ time interval (second)
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
---
#response
bool result
\ No newline at end of file
#request
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 multiplier #Data struct of tap zoom multiplier used by user. Limit: 1~5
float32 x # range from 0~1, top left corner is origin point
float32 y # range from 0~1, top left corner is origin point
---
#response
bool result
\ No newline at end of file
#request
uint8 start_stop
uint8 payload_index #see enum class PayloadIndex in common_type.h
uint8 direction #see enum class ZoomDirection in common_type.h
uint8 speed #see enum class ZoomSpeed in common_type.h
---
#response
bool result
\ No newline at end of file
#request
---
#response
WaypointV2[] mission
bool result
\ No newline at end of file
#constant for arm
uint8 DISARM_COMMAND = 0
uint8 ARM_COMMAND = 1
#request
uint8 arm # see constants
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
#constant for tasks
uint8 TASK_GOHOME = 1
uint8 TASK_TAKEOFF = 4
uint8 TASK_LAND = 6
#request
uint8 task # see constants above for possible tasks
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
#request
---
#reponse
bool result
\ No newline at end of file
#constant for tasks
uint8 TASK_GOHOME = 1
uint8 TASK_POSITION_AND_YAW_CONTROL = 2
uint8 TASK_GOHOME_AND_CONFIRM_LANDING = 3
uint8 TASK_TAKEOFF = 4
uint8 TASK_VELOCITY_AND_YAWRATE_CONTROL = 5
uint8 TASK_LAND = 6
uint8 START_MOTOR = 7
uint8 STOP_MOTOR = 8
uint8 TASK_EXIT_GO_HOME = 12
uint8 TASK_EXIT_LANDING = 14
uint8 TASK_FORCE_LANDING_AVOID_GROUND = 30 #/*!< confirm landing */
uint8 TASK_FORCE_LANDING = 31 #/*!< force landing */
#request
uint8 task # see constants above for possible tasks
JoystickParams joystickCommand #Provide Position and Velocity control
uint32 velocityControlTimeMs #Velocity control time
float32 posThresholdInM #(Meter)
float32 yawThresholdInDeg #(Degree)
---
#response
bool result
#request
WaypointV2Action[] actions
---
#response
bool result
\ No newline at end of file
#request
---
#response
bool result
uint8 horizon_avoid_enable_status #0:disable 1:enable 0xF:invalid
uint8 upwards_avoid_enable_status
\ No newline at end of file
#request
---
#response
uint8 drone_type
\ No newline at end of file
#request
---
#response
# Global cruise speed of mission
# unit: m/s
# range:[0,WayPointV2InitSettings::maxFlightSpeed]
float32 global_cruisespeed
bool result
\ No newline at end of file
#request
---
#response
bool result
uint16 altitude
\ No newline at end of file
#request
bool enable
---
#reponse
bool result
uint8 deviceIndex # When the error code is related to camera or gimbal device,
# it will tell you which device it is.
HMSPushInfo[] errList # error code list in each pushing
uint32 timeStamp
\ No newline at end of file
#request
---
#response
bool result
\ No newline at end of file
#request
uint8 first_smart_battery = 1
uint8 second_smart_battery = 2
uint8 batteryIndex
---
#response
SmartBatteryDynamicInfo smartBatteryDynamicInfo
\ No newline at end of file
#request
---
#response
BatteryWholeInfo battery_whole_info
\ No newline at end of file
Header header
# ts is the time it takes to achieve the desired angle,
# so the shorter the time, the faster the gimbal rotates.
#request
bool is_reset
uint8 payload_index
# rotation cooradiration
# 0 = execute angle command based on the previously set reference point
# 1 = execute angle command based on the current point
uint8 rotationMode
# pitch angle in degree, unit : deg
float32 pitch
# roll angle in degree, unit : deg
float32 roll
# yaw angle in degree, unit : deg
float32 yaw
#execution time, unit : second
float64 time
---
#response
bool result
#request
WaypointV2InitSetting waypointV2InitSettings
uint16 polygonNum
float32 radius
uint16 actionNum
---
bool result
\ No newline at end of file
#request
JoystickParams joystickCommand
---
#response
bool result
\ No newline at end of file
#request
bool enable
---
#response
bool result
\ No newline at end of file
#constant for mode
uint8 MODE_PWM_OUT = 0
#uint8 MODE_PWM_IN = 1 #PWM_IN is not functioning correctly
uint8 MODE_GPIO_OUT = 2
uint8 MODE_GPIO_IN = 3
uint8 MODE_ADC = 4
uint8 CHANNEL_0 = 0
uint8 CHANNEL_1 = 1
uint8 CHANNEL_2 = 2
uint8 CHANNEL_3 = 3
uint8 CHANNEL_4 = 4
uint8 CHANNEL_5 = 5
uint8 CHANNEL_6 = 6
uint8 CHANNEL_7 = 7
uint8 TURN_ON = 0 # Control PWM on/off
uint8 TURN_OFF = 1
#request
uint8 action # Turn On/Off, 0: ON 1: OFF
uint8 mode # see constants above for possible modes
bool block # Block/Non-block Ouput
uint8 channel # 0-7
uint32 init_on_time_us # on time for pwm duty cycle in micro-seconds, 0-20000(0%-100%)
uint8 gpio_value # 0: Low, 1:High just for GPIO_OUT
uint16 pwm_freq # set pwm frequency in Hz
---
uint32 read_value
#constant for mode
uint8 MODE_PWM_OUT = 0
#uint8 MODE_PWM_IN = 1 #PWM_IN is not functioning correctly
uint8 MODE_GPIO_OUT = 2
uint8 MODE_GPIO_IN = 3
uint8 MODE_ADC = 4
#request
uint8 mode # see constants above for possible modes
uint8 channel # 0-7
uint32 init_on_time_us # on time for pwm duty cycle in micro-seconds
uint16 pwm_freq # set pwm frequency in Hz
---
uint8 channel # 0-7
uint32 init_on_time_us # on time for pwm duty cycle in micro-seconds
---
#constant for action
uint8 ACTION_START = 0
uint8 ACTION_STOP = 1
uint8 ACTION_PAUSE = 2
uint8 ACTION_RESUME = 3
#response
uint8 action # see constants above for possible actions
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
---
MissionHotpointTask hotpoint_task
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
\ No newline at end of file
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
\ No newline at end of file
float32 radius # in meters
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
float32 yaw_rate # degree/s
uint8 direction # 0: counter-clockwise, 1: clockwise
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
MissionHotpointTask hotpoint_task
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
\ No newline at end of file
---
uint8 waypoint_mission_count
uint8 hotpoint_mission_count
\ No newline at end of file
#constant for action
uint8 ACTION_START = 0
uint8 ACTION_STOP = 1
uint8 ACTION_PAUSE = 2
uint8 ACTION_RESUME = 3
#request
uint8 action # see constants for possible actions
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
---
MissionWaypointTask waypoint_task
\ No newline at end of file
---
float32 speed
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
\ No newline at end of file
float32 speed
---
bool result
\ No newline at end of file
MissionWaypointTask waypoint_task # see msg/MissionWaypointTask.msg
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
#request
bool enable_obtain
---
#reponse
bool result
\ No newline at end of file
# constants for different actions
uint8 START_WAYPOINT_PATH = 1
uint8 START_POSITION_PATH = 2
uint8 STOP_MOTION = 3
uint8 LAND = 4
uint8 GO_HOME = 5
uint8 TAKEOFF = 6
uint8 CALIBRATE_POS_REF = 7
# request
bool start
uint8 action
---
# response
bool result
#request
---
#response
bool result
\ No newline at end of file
---
uint32 version
string hardware
\ No newline at end of file
#request
---
#response
bool result
\ No newline at end of file
#constant for control_enable
uint8 RELEASE_CONTROL = 0
uint8 REQUEST_CONTROL = 1
#request
uint8 control_enable # see constants above
---
bool result
# for debugging usage
uint8 cmd_set
uint8 cmd_id
uint32 ack_data
uint8[] data #length(data) <= 100
---
bool result
uint8[] data #length(data) <= 255
---
bool result
#request
bool enable
---
#response
bool result
\ No newline at end of file
---
bool result
\ No newline at end of file
#request
# Global cruise speed of mission
# unit: m/s
# range:[0,WayPointV2InitSettings::maxFlightSpeed]
float32 global_cruisespeed
---
#response
bool result
\ No newline at end of file
uint16 altitude
---
bool result
\ No newline at end of file
uint32 frequency # frequency in Hz
uint16 tag # the tag is to distinguish between different call
----
uint8 result
#request
float64 latitude #/*!< unit: rad */
float64 longitude #/*!< unit: rad */
---
#response
bool result
\ No newline at end of file
#request
#contant for horizontal_mode
# Set the control-mode to control pitch & roll angle of the vehicle.
# Need to be referenced to either the ground or body frame
# by HorizontalCoordinate setting.
# Limit: 35 degree
uint8 HORIZONTAL_ANGLE = 0
# Set the control-mode to control horizontal vehicle velocities.
# Need to be referenced to either the ground or body frame by
# HorizontalCoordinate setting.
# Limit: 30 m/s
uint8 HORIZONTAL_VELOCITY = 1
# Set the control-mode to control position offsets of pitch & roll directions
# Need to be referenced to either the ground r body frame by HorizontalCoordinate setting.
# Limit: N/A
uint8 HORIZONTAL_POSITION = 2
# Set the control-mode to control rate of change of the vehicle's attitude
# Need to be referenced to either the ground or body frame by HorizontalCoordinate setting.
# Limit: 150.0 deg/s
uint8 HORIZONTAL_ANGULAR_RATE = 3
#contant for vertical_mode
# Set the control-mode to control the vertical
# speed of UAV, upward is positive
# Limit: -5 to 5 m/s
uint8 VERTICAL_VELOCITY = 0
# Set the control-mode to control the height of UAV
# Limit: 0 to 120 m
uint8 VERTICAL_POSITION = 1
# Set the control-mode to directly control the thrust
# Range: 0% to 100%
uint8 VERTICAL_THRUST = 2
#contant for yaw_mode
# Set the control-mode to control yaw angle.
# Yaw angle is referenced to the ground frame.
# In this control mode, Ground frame is enforeced in Autopilot.
uint8 YAW_ANGLE = 0
# Set the control-mode to control yaw angular velocity.
# Same reference frame as YAW_ANGLE.
# Limite: 150 deg/s
uint8 YAW_RATE = 1
#contant for horizontal_coordinate
# Set the x-y of ground frame as the horizontal frame (NEU) */
uint8 HORIZONTAL_GROUND = 0
# Set the x-y of body frame as the horizontal frame (FRU) */
uint8 HORIZONTAL_BODY = 1
#contant for stable_mode
# Disable the stable mode
uint8 STABLE_DISABLE = 0
# Enable the stable mode
uint8 STABLE_ENABLE = 1
# Only when the GPS signal is good (health_flag >=3),horizontal
# position control (HORIZONTAL_POSITION) related control modes can be used.
# Only when GPS signal is good (health_flag >=3),or when AdvancedSensing
# system is working properly with Autopilot,horizontal velocity control
# (HORIZONTAL_VELOCITY)related control modes can be used.
uint8 horizontal_mode
# We suggest developers do not use VERTICAL_POSITION control mode indoor
# when your UAV flight height is larger than 3 meters.
# This is because in indoor environments, barometer can be inaccurate, and
# the vertical controller may fail to keep the height of the UAV.
uint8 vertical_mode
uint8 yaw_mode
uint8 horizontal_coordinate
# Only works in Horizontal velocity control mode
# In velocity stable mode, drone will brake and hover at one position once
# the input command is zero.
# Drone will try to stay in position once in hover state.
# In velocity non-stable mode, drone will follow the velocity command and
# doesn’t hover when the command is zero.
# That’s to say drone will drift with the wind.
uint8 stable_mode
---
#response
bool result
\ No newline at end of file
#set local position
# true: set Local position reference
#request
---
bool result
#constant for vga image frequency
uint8 FPV_CAMERA = 7
uint8 MAIN_CAMERA = 0
uint8 VICE_CAMERA = 1
uint8 TOP_CAMERA = 2
# use above constants to config freq.
uint8 request_view
# 1 for start camera stream, 0 for stop
uint8 start
---
bool result
\ No newline at end of file
#constant for vga image frequency
uint8 FPV_CAM = 0
uint8 MAIN_CAM = 1
# use above constants to config freq.
uint8 cameraType
# 1 for start camera stream, 0 for stop
uint8 start
---
bool result
\ No newline at end of file
#request
---
#response
bool result
\ No newline at end of file
# assign value to 1 to subscribe
uint8 front_right_240p
uint8 front_left_240p
uint8 down_front_240p
uint8 down_back_240p
# if unsubscribe_240p is 1,
# service will unsubscribe no matter what
uint8 unsubscribe_240p
---
bool result
# assign value to 1 to subscribe
uint8 front_depth_240p
# if unsubscribe_240p is 1,
# service will unsubscribe no matter what
uint8 unsubscribe_240p
---
bool result
\ No newline at end of file
#constant for vga image frequency
uint8 VGA_20_HZ = 0
uint8 VGA_10_HZ = 1
# use above constants to config freq.
uint8 vga_freq
# assign value to 1 to subscribe
uint8 front_vga
# if unsubscribe_vga is 1,
# service will unsubscribe no matter what
uint8 unsubscribe_vga
---
bool result
\ No newline at end of file
#request
---
#response
bool result
\ No newline at end of file
#request
bool enable_sub
---
#response
bool result
\ No newline at end of file
#request
bool enable_sub
---
#response
bool result
\ No newline at end of file
#request
# WaypointV2Action[] actions
---
#response
bool result
\ No newline at end of file
#request
---
#response
bool result
\ No newline at end of file
Subproject commit 6065db76123d0af3d565d8db8b28d1970a7f3000
Subproject commit 8f99f41786f907a8894478de9ba984d5f965049a
velodyne @ 7ee199f4
Subproject commit 7ee199f4cdfbd10659afbb8be184f202239694cb
Subproject commit 65949bdc5c9468d18c51aed9073d020bec892532
Subproject commit c791220cefd0abf02c6719e2ce0fea465857a88e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment