mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 07:07:58 +00:00
drone: Update client handling emergency land message and show start animation point error only not in active state
This commit is contained in:
@@ -607,7 +607,11 @@ def _command_land(*args, **kwargs):
|
||||
|
||||
@messaging.message_callback("emergency_land")
|
||||
def _emergency_land(*args, **kwargs):
|
||||
logger.info(flight.emergency_land().message)
|
||||
try:
|
||||
result = flight.emergency_land()
|
||||
logger.info(result.message)
|
||||
except rospy.ServiceException:
|
||||
logger.error("Can't execute emergency land: service is unavailable!")
|
||||
|
||||
|
||||
@messaging.message_callback("disarm")
|
||||
@@ -798,7 +802,7 @@ class Telemetry:
|
||||
start_action = copter.animation.get_start_action(
|
||||
copter.config.animation_start_action, self.ros_telemetry.z,
|
||||
copter.config.animation_takeoff_level, copter.config.animation_ground_level,
|
||||
copter.config.animation_ratio, offset)
|
||||
copter.config.animation_ratio, offset, self.fcu_status)
|
||||
return [x,y,z,yaw,start_action,start_delay]
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -322,7 +322,7 @@ class Animation(object):
|
||||
return ground_level <= self.get_scaled_output_min_z(ratio, offset)
|
||||
|
||||
def get_start_action(self, start_action, current_height, takeoff_level,
|
||||
ground_level, ratio=(1,1,1), offset=(0,0,0)):
|
||||
ground_level, ratio=(1,1,1), offset=(0,0,0), state="STANDBY"):
|
||||
# Check output frames
|
||||
if not self.output_frames:
|
||||
return 'error: empty output frames'
|
||||
@@ -335,7 +335,7 @@ class Animation(object):
|
||||
ground_level = float(ground_level)
|
||||
except ValueError:
|
||||
return 'error in [ANIMATION] ground_level parameter'
|
||||
if ground_level > self.get_scaled_output_min_z(ratio, offset):
|
||||
if state != "ACTIVE" and ground_level > self.get_scaled_output_min_z(ratio, offset):
|
||||
return 'error: some animation points are lower than ground level for {:.2f}m (max)'.format(
|
||||
ground_level - self.get_scaled_output_min_z(ratio, offset)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user