我希望我的直升机返回到特定高度发射,因为现在我在ArduPilot站点上运行一切。首先,我尝试使用simple_goto()
vehicle.commands.download()
vehicle.commands.wait_ready()
finish_location = deepcopy(vehicle.home_location)
finish_location.alt = flight_altitude
vehicle.simple_goto(finish_location)simple_goto()在其他位置工作得很好,但是当我使用vehicle.home_location时,它导致直升机下降到-7.5米的高度。更重要的是,直升机只是下降,它不会飞到finish_location。
所以我尝试使用RTL模式
self.vehicle.mode = VehicleMode("RTL")它工作得很好,但我找不到方法来设置RTL高度到我想要的flight_altitude参数,它以默认的15米运行。
发布于 2016-06-30 22:53:25
下面的代码运行良好。
vehicle.commands.download()
vehicle.commands.wait_ready()
target_location = LocationGlobalRelative(0, 0, 0)
target_location.lat = vehicle.home_location.lat
target_location.lon = vehicle.home_location.lon
target_location.alt = target_altitude我还是不明白为什么
vehicle.commands.download()
vehicle.commands.wait_ready()
finish_location = deepcopy(vehicle.home_location)
finish_location.alt = flight_altitude
vehicle.simple_goto(finish_location)不起作用。
发布于 2016-09-28 02:18:18
设置RTL高度的方法是通过参数。如果希望它以相同的高度返回,请将参数设置为0。
vehicle.parameters['RTL_ALT'] = 0
vehicle.mode = VehicleMode("RTL")请看一下文档。http://ardupilot.org/copter/docs/parameters.html#rtl-alt-rtl-altitude
https://stackoverflow.com/questions/38120699
复制相似问题