Difference between revisions of "Day 5"

From Bambi
Jump to: navigation, search
(Log)
(Log)
Line 1: Line 1:
 
= Log =
 
= Log =
# <code>MAV_CMD_NAV_TAKEOFF_LOCAL</code> is not support in px4 (command 24), so we are forced to use the one without _LOCAL. For this reason we are force to send absolute altitude which turns out to be tricky:<br />MAVlink uses WGS84 convention for altitude and latitude in global position messages (i.e <code>GPS_RAW_INT</code> the one used by mavros to gather information about current GPS fix) while it use AMSL convention for '''altitude'''. On the other hand, mavros global_position plugin, publish messages with altitude converted in WGS84 using the GeographicLib library (operation which requires 24 MB to be loaded on ram). In this way we would have to reconvert altitude back before adding the require offset to obtain the absolute altitude used in TAKEOFF mavlink message.
+
# <code>MAV_CMD_NAV_TAKEOFF_LOCAL</code> is not support in px4 (command 24), so we are forced to use the one without _LOCAL. For this reason we are force to send absolute altitude which turns out to be tricky:<br />MAVlink uses WGS84 convention for altitude and latitude in global position messages (i.e <code>GPS_RAW_INT</code> the one used by mavros to gather information about current GPS fix) while it use AMSL convention for '''altitude'''. On the other hand, mavros global_position plugin, publish messages with altitude converted in WGS84 using the GeographicLib library (operation which requires 24 MB to be loaded on ram). In this way we would have to reconvert altitude back before adding the require offset to obtain the absolute altitude used in TAKEOFF mavlink message.<br />'''We choose''' to modify mavros global_position plugin so that it does not convert altitude. Now we have an exact mapping between MAVLink and mavros global position messages and the problem of having different conventions no more occurs.
'''We choose''' to modify mavros global_position plugin so that it does not convert altitude. Now we have an exact mapping between MAVLink and mavros global position messages and the problem of having different conventions no more occurs.
 
  
 
= KML Parser Library for Python =
 
= KML Parser Library for Python =

Revision as of 23:39, 8 August 2018

Log

  1. MAV_CMD_NAV_TAKEOFF_LOCAL is not support in px4 (command 24), so we are forced to use the one without _LOCAL. For this reason we are force to send absolute altitude which turns out to be tricky:
    MAVlink uses WGS84 convention for altitude and latitude in global position messages (i.e GPS_RAW_INT the one used by mavros to gather information about current GPS fix) while it use AMSL convention for altitude. On the other hand, mavros global_position plugin, publish messages with altitude converted in WGS84 using the GeographicLib library (operation which requires 24 MB to be loaded on ram). In this way we would have to reconvert altitude back before adding the require offset to obtain the absolute altitude used in TAKEOFF mavlink message.
    We choose to modify mavros global_position plugin so that it does not convert altitude. Now we have an exact mapping between MAVLink and mavros global position messages and the problem of having different conventions no more occurs.

KML Parser Library for Python

To have some sample data easily available and customizable, it is convenient to use the .kml format. To be able to handle it in the python boundary border, we may use pyKml. To install we need:

  1. sudo apt-get install libxml2-dev libxslt-dev python-dev
  2. sudo pip install lxml
  3. sudo pip install pykml

The KML file has been generated using https://www.doogal.co.uk/polylines.php and can be checked with https://www.doogal.co.uk/KmlViewer.php