Hi,

I have been reading the developer documentation, and I would like to confirm that what I intend to do is possible and respects the development philosophy of Librepilot. Here is what I would like to do:

Minimal:
Control the ESCs directly from a computer running ROS or pure python. I have position and orientation feedback from a motion capture system connected to the computer.

Ideal:
Minimal + override computer command with a transmitter if desired.

I have a good experience programming Atmega controllers at low level, as well as general programming experience with C, C# and python. I understand that the UAVtalk protocol could allow me to send commands directly to the quadcopter. Is that correct? I would have to generate at python library with an XML file. Then, my python code could communicate through an XBee or bluetooth module to the firmware using the serial port.

Would that system work with low latency? I would be using the motion capture system that gives me updates at 250 Hz. Could the communication be done at that speed if I only send commands and request no telemetry?

Thanks, help could save me a lot of time!

f5soh

  • *****
  • 4572
    • LibrePilot
Re: Control librepilot firmware from a computer with Python (ROS) and XBee
« Reply #1 on: October 24, 2017, 11:16:48 pm »
Hi,

There is already a python library allowing receiving and sending commands.
Examples can be found here under python/examples dir

Communication is done using serial port (VCP) or any other serial telemetry.

Basically, starting from source code you need to do the following before starting examples:
Code: [Select]
make uavobjects
make uavobjects_python_install

Search for python in forum, you will find answers. The most advanced work can be found in 'next' branch now.
https://forum.librepilot.org/index.php?topic=3691.0

Re: Control librepilot firmware from a computer with Python (ROS) and XBee
« Reply #2 on: October 25, 2017, 12:18:59 am »
Thank you very much, it is exactly what I need! I will do my research. I hope I can get the refresh rate and latency needed from the serial port.