Difference between revisions of "Day 11"
From Bambi
(→LOG) |
|||
Line 1: | Line 1: | ||
= LOG = | = LOG = | ||
− | + | # Discovered that PX4 does not implement <code>SET_POSITION_TARGET_GLOBAL_INT</code> and mavros mess up converting from global setpoint to local one => Our approach is now: | |
+ | #* <code>trajectory_generator</code> node now publish local setpoints in Trajectory message. This has been done referring all the points (UTM) to home position (UTM) (we have just needed to subtract easter and northen of the home position). | ||
+ | #* Send the obtained trajectory with <code>flight_controller</code> node publishing on mavros <code>setpoint_raw/local</code> topic. The "raw" version has been chosen because it allows to send position, velocity and acceleration all in the same message. The mavros plugin then send <code>SET_POSITION_TARGET_LOCAL_NED</code> mavlink messages. | ||
+ | #* N.B Mavros itself handle the conversion from ENU (East North UP) to NED (North East Down) so the setpoint we send are in ENU coordinate system. | ||
# <code>mc_pos_control_main.cpp:540</code> uses the paramter <code>MPC_ALT_MODE</code>, to forward the rangefinder senser velocity to the internal z_v state, to enable terrain following | # <code>mc_pos_control_main.cpp:540</code> uses the paramter <code>MPC_ALT_MODE</code>, to forward the rangefinder senser velocity to the internal z_v state, to enable terrain following | ||
# We need to ensure in FlightController, by subscribing the altitude topic and eventually doing some calculations, that the information in the setpoint, which INTERALLY we treat it as RELATIVE TO GROUND, in the trajectory with the list of setpoints, is CONVERTED IN TO A PX4 compatible ALTITUDE | # We need to ensure in FlightController, by subscribing the altitude topic and eventually doing some calculations, that the information in the setpoint, which INTERALLY we treat it as RELATIVE TO GROUND, in the trajectory with the list of setpoints, is CONVERTED IN TO A PX4 compatible ALTITUDE |
Revision as of 18:26, 14 August 2018
LOG
- Discovered that PX4 does not implement
SET_POSITION_TARGET_GLOBAL_INT
and mavros mess up converting from global setpoint to local one => Our approach is now:-
trajectory_generator
node now publish local setpoints in Trajectory message. This has been done referring all the points (UTM) to home position (UTM) (we have just needed to subtract easter and northen of the home position). - Send the obtained trajectory with
flight_controller
node publishing on mavrossetpoint_raw/local
topic. The "raw" version has been chosen because it allows to send position, velocity and acceleration all in the same message. The mavros plugin then sendSET_POSITION_TARGET_LOCAL_NED
mavlink messages. - N.B Mavros itself handle the conversion from ENU (East North UP) to NED (North East Down) so the setpoint we send are in ENU coordinate system.
-
-
mc_pos_control_main.cpp:540
uses the paramterMPC_ALT_MODE
, to forward the rangefinder senser velocity to the internal z_v state, to enable terrain following - We need to ensure in FlightController, by subscribing the altitude topic and eventually doing some calculations, that the information in the setpoint, which INTERALLY we treat it as RELATIVE TO GROUND, in the trajectory with the list of setpoints, is CONVERTED IN TO A PX4 compatible ALTITUDE
- Note altitude (from altitude topic) .relative means relative to home position (!)
- TODO: Check if altitude.terrain gets meaningful values when mounting an onboard rangefinder sensor (it should)
- Found out that PX4 does not handle
MAV_FRAME_GLOBAL_TERRAIN_ALT
inMISSIO_ITEM
command so we decided to use absolute altitude for the orthophoto waypoint adoptingMAV_FRAME_GLOBAL
.