Drone: Begin code organisation for GPS support

This commit is contained in:
Arthur Golubtsov
2020-05-21 00:11:07 +03:00
parent ca173200d9
commit 541a64a3ca
2 changed files with 10 additions and 5 deletions

View File

@@ -49,7 +49,6 @@ land_timeout = float(default=10.0, min=0)
common_offset = float_list(default=list(0, 0, 0), min=3, max=3)
[FLOOR FRAME]
enabled = boolean(default=False)
parent = string(default=map)
# Frame translation (x, y, z)
# __list__ x y z
@@ -58,6 +57,11 @@ translation = float_list(default=list(0.0, 0.0, 0.0), min=3, max=3)
# __list__ roll pitch yaw
rotation = float_list(default=list(0.0, 0.0, 0.0), min=3, max=3)
[GPS FRAME]
lat = float(default=0)
lon = float(default=0)
yaw = float(default=0)
[ANIMATION]
takeoff_detection = boolean(default=True)
land_detection = boolean(default=True)

View File

@@ -99,10 +99,9 @@ class CopterClient(client.Client):
LedLib.init_led(self.config.led_pin)
task_manager_instance.start() # TODO move to self
if self.config.copter_frame_id == "floor":
if self.config.floor_frame_enabled:
self.start_floor_frame_broadcast()
else:
rospy.logerr("Can't make floor frame!")
self.start_floor_frame_broadcast()
elif self.config.copter_frame_id == "gps":
self.start_gps_frame_broadcast()
start_subscriber()
telemetry.start_loop()
@@ -120,6 +119,8 @@ class CopterClient(client.Client):
trans.child_frame_id = self.config.copter_frame_id
static_bloadcaster.sendTransform(trans)
def start_gps_frame_broadcast(self):
return
def restart_service(name):
os.system("systemctl restart {}".format(name))