dronekit-python

Dronekit-python running in docker connecting to MAVProxy on host

好久不见. 提交于 2021-01-29 13:51:07
问题 I am using dronekit-python in a docker container and am attempting to connect to an instance of MAVProxy running on my host machine (Mac OSX) using the following command: vehicle = connect('udp:host.docker.internal:14551', wait_ready=True) but am getting the following error: File "/usr/local/lib/python3.7/site-packages/pymavlink/mavutil.py", line 1015, in __init__ self.port.bind((a[0], int(a[1]))) OSError: [Errno 99] Cannot assign requested address Does anyone know what the issue is here? I

Have any of these attempts to get GPS time into a mavlink been successful?

我只是一个虾纸丫 提交于 2019-12-25 09:11:04
问题 I'm trying to get GPS time out of a pixhawk. I've found a bunch of discussions about such but none that appear to have been resolved. Is there any update? This guy and this guy were both told to just use system time (which is not UTC) I also tried to get GLOBAL_POSITION_INT_COV but found it was not available. Here is a long dev discussion about such that was never resolved (circa 2013) Another dev discussion that references a bunch of pull requests for such - but doesn't look like any of them

Get ardupilot output channels

こ雲淡風輕ζ 提交于 2019-12-25 01:07:05
问题 How do we get output channel values of an ardupilot from dronekit-python? We can get input channels from vehicle.channels but I couldn't find anything similar for output channels. EDIT: from time import sleep from dronekit import connect import dronekit_sitl sitl = dronekit_sitl.start_default() connection_string = sitl.connection_string() vehicle = connect(connection_string,wait_ready=True) while not vehicle.is_armable: sleep(1) print"Initializing" vehicle.armed = True while not vehicle.armed

How can I get the GPS time from the pixhawk, on a “companion computer”

岁酱吖の 提交于 2019-12-24 16:31:09
问题 My project will have two "companion computers" on-board a quadcopter. One will speak to APMCopter autopilot running on a pixhawk, using dronekit python, and the other will communicate with it's peer over ethernet. I'd like both computers to have closely synchronized time, and I'd like them both to be synchronized to the GPS time from the GPS connected to the pixhawk. The documentation for mavlink indicates that there is a "system time" message which includes the GPS time in uSec. How do I

GPS Timestamp with Dronekit-python API

冷暖自知 提交于 2019-12-24 02:57:21
问题 I'm currently using the Dronekit-python API with MAVProxy to log attitude from a Pixhawk on an onboard computer running Linux. These measurements need to be integrated with external data for image processing, and I'm hoping to use a GPS timestamp for synchronization. The time of interest is time_utc in MAVLink message #63 (GLOBAL_POSITION_INT_COV), as documented here, and I was unable to find any GPS timestamp parameter listed in the DroneKit-Python API Reference. I'd appreciate any

How to set copters Attitude via DroneKit — SET_ATTITUDE_TARGET not working

人走茶凉 提交于 2019-12-12 10:15:58
问题 I have Dronekit working properly with SITL sim, however for my project I want to be able to command the attitude of the copter. Obviously I can do this via RC over ride in ALT_HOLD mode, however I don't like that approach. I have been trying to use the Mavlink message SET_ATTITUDE_TARGET (#82), however when I send the messages to the sim, nothing happens. I have been able to set the velocity and the position, and those work fine. Here is my function: def att_msg_mode(): print "===========

How to connect between Simulated Vehicle and Companion Computers at the same time?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 03:34:14
问题 I was wondering if it was possible to connect to a virtual drone and physical drone at the same time, UDP and USB. This is to test ground station like functionality to be able to control multiple drones. I only have 1 physical and want to test between both. Or to at least prove my suspicion that api = local_connect() # Get an APIConnection all_vehicle = api.get_vehicles() Does in fact give me all possible connected vehicles. And just play with it from there. Edit: What my process was is

Controlling movement without GPS

故事扮演 提交于 2019-12-12 02:09:00
问题 I was trying to use the DroneKit-Python API to control the movement of a drone. I've been reading what it's in that link, but I can't find what I need. I want to be able to run the code with the dron indoors (and of course outdoors), so I can't rely in the GPS. I've tried to eliminate that part and use only the send_ned_velocity() method (without the propeller). But I couldn't hear a significant change in the movement of the engines. The only way I can think of is using the channel_override ,

How to set copters Attitude via DroneKit — SET_ATTITUDE_TARGET not working

北城余情 提交于 2019-12-08 14:10:32
I have Dronekit working properly with SITL sim, however for my project I want to be able to command the attitude of the copter. Obviously I can do this via RC over ride in ALT_HOLD mode, however I don't like that approach. I have been trying to use the Mavlink message SET_ATTITUDE_TARGET (#82), however when I send the messages to the sim, nothing happens. I have been able to set the velocity and the position, and those work fine. Here is my function: def att_msg_mode(): print "=========== Building Message" veh1.mode = VehicleMode("ALT_HOLD") msg = veh1.message_factory.set_attitude_target