Commit Graph

576 Commits

Author SHA1 Message Date
RomanBapst
807cfc8aac mavlink: fix race condition in mavlink_command_sender
- if we receive an ack for a command through a specific mavlink channel
then do not drop the corresponding command in the queue if this specific
mavlink channel did not issue the command. If we don't do this we can
end up in a situation where we associate an ack coming through a specific
mavlink channel to a command in the queue which was not requested by this mavlink channel.
Moreover, the actual command for which the ack was meant remains in the
queue and eventually triggers a timeout.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-08-05 12:07:05 +02:00
Daniel Agar
e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04:00
Daniel Agar
dcccbbe584 Mavlink receiver ODOMETRY fix code style 2019-08-02 21:36:20 -04:00
Nick Steele
b203bc15df Fix rotation of odometry velocities from body frame to local frame in the mavlink receiver odometry handler
Summary:
PX4 assumed that odometry orientation was a way to rotate data from parent frame to child frame, so to rotate child to parent, it was taking the inverse rotation of the odometry orientation,
but orientation rotates the parent frame to the child frame, whereas for data, it represents a rotation from child to parent; hence, the rotation inverse operations were removed.

Test Plan: Checked that vehicle_mocap_odometry and vehicle_local_position gave correct linear velocities. Also visualized px4 output twist in rviz.
2019-08-02 23:15:47 +01:00
Timothy Scott
ecf396443f Minor bugfix 2019-07-17 10:47:56 +02:00
Timothy Scott
7c05073044 Fixed overflowing tslc. 2019-07-16 09:43:58 +02:00
Timothy Scott
e25ad348e8 Added message handler for UTM_GLOBAL_POSITION 2019-07-16 09:43:58 +02:00
Martina Rivizzigno
09bfb00c88 Obstacle_distance: use only one increment in float directly
CollisionPrevention: rename a few variables to make the code more readable
2019-07-15 10:58:00 +02:00
Timothy Scott
dce1dda871 Fixed incorrect timestamps 2019-07-03 14:39:59 +02:00
JaeyoungLim
4c4bcc5fdb Mavlink: Fill in thrust field correctly for offboard rates setpoints on fixed wing (#12311)
* Fill in thrust field for rates sp
2019-06-20 17:17:32 +02:00
SalimTerryLi
e0f3fc8d00 Mavlink receiver SET_ATTITUDE_TARGET fill the correct throttle field by checking its frametype in offboard mode (#12149) 2019-06-18 02:06:41 +02:00
mcsauder
742c22d099 Rename _param_sub to _param_update_sub and initialize. Re-define and re-implement the update_params() method and only call if parameters have been updated. 2019-06-17 09:41:30 +02:00
mcsauder
c92b8b03cd Move variable initialization from constructor to declarations in MavlinkReceiver class, alphabetize var lists. Added update_params() method to ensure that parameters subscribed to are updated routinely. 2019-06-17 09:41:30 +02:00
Daniel Agar
7c4bf6ddae Mavlink ODOMETRY (331) support MAV_FRAME_BODY_FLU 2019-06-16 13:23:57 -04:00
JaeyoungLim
d7d0bd2764 Mavlink: Enable gimbal control using SET_ACTUATOR_CONTROL_TARGET while controlling the vehicle offboard (#12146)
* Stop ignoring setpoints when actuator setpoints are for the gimbal
2019-06-15 21:35:41 -04:00
pedro-roque
a707403eaf mc_att_ctrl: added yawrate control from offboard.
This commit adds Roll Pitch Yawrate Thrust (RPYrT) setpoint control to the
PX4 stack, enabling the UAV to follow specific yawrates sent from
offboard. It also introduces individual body_rate flags, along the
lines of mavros.

Tested on a MoCap enabled flight arena in KTH Royal Institute of
Technology, Stockholm. The MAV receives RPYrT setpoints from an
external PID controller to stabilize around position setpoints.
The UAV is also externally disturbed to assess the stability to
external unmodeled events.

Fixed Kabir comments.

Removed deprecated ignore_bodyrate.

Fixed integration test.
2019-06-04 08:26:09 +02:00
Matthias Grob
ac002db25c MAVLink/Commander: @Pedro-Roque's offboard yawrate handling 2019-06-04 08:26:09 +02:00
Daniel Agar
579cbbb42c mavlink move to new lightweight uORB::Subscription 2019-06-03 17:06:21 -04:00
Gabriel Moreno
f9324fb76a mavlink: set correct distance_sensor timestamp. Fixes #11840
When PX4FLOW is connected to PX4 through MAVLink (e.g., through a USB
port), the timestamp assigned to the distance_sensor was wrong. This fix
uses the same timestamp assigned to the optical_flow message created from
the same OPTICAL_FLOW_RAD MAVLink message.

Signed-off-by: Gabriel Moreno <gabrielm@cs.cmu.edu>
2019-04-15 20:31:15 +02:00
mcsauder
9540869c20 Alphabetize a few methods and variable orders in mavlink_receiver.h. 2019-04-11 08:31:30 +02:00
Oleg Kalachev
319723a1ec mavlink_receiver: ignore BATTERY_STATUS of other system 2019-03-23 15:18:46 -04:00
Claudio Micheli
fb990d7de3 Removed subscribtion to multiple _telemetry_status instances.
Since commander handles all telemetry_status the same there is no need to subscribe to multiple instances.


Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
Claudio Micheli
b85cceebe9 mavlink_receiver: Ignore heartbeats coming from other vehicles.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-03-12 11:24:33 +01:00
baumanta
a98f5d2ab2 suggestion for treating obstacle avoidance heartbeats 2019-03-12 11:24:33 +01:00
Daniel Agar
6dec451bab HEARTBEAT and commander failsafe handling cleanup 2019-03-12 11:24:33 +01:00
mcsauder
2773fe6a54 Deprecate _hil_frames and _old_timestamp member vars and dead logic from MavlinkReceiver class. 2019-03-11 08:03:37 +01:00
mcsauder
d42bb01e0c Standardize method definition newlines in mavlink_receiver.cpp. 2019-03-02 13:09:41 -05:00
Daniel Agar
e2bf4b1894 List container improvements and testing
- support range based for loops
 - add remove() method to remove a node
 - add clear() to empty entire list and delete nodes
 - add empty() helper
2019-03-01 21:01:04 -05:00
Mark Sauder
c04147c53c Mavlink receiver: Move most variable initializations out of the constructor to the variable declarations 2019-02-26 11:48:02 -05:00
sfalexrog
9355324209 mavlink/MavlinkReceiver: Use hrt_absolute_time for distance_sensor timestamps 2019-02-25 12:07:53 +01:00
Oleg Kalachev
fbc8d01a7e Rename distance_sensor.covariance to variance 2019-02-22 18:31:27 +00:00
Oleg Kalachev
ec3f1fd5c2 mavlink_receiver: fix DISTANCE_SENSOR covariance handling 2019-02-22 18:31:27 +00:00
mcsauder
6762f09490 Move variable initializations to header file that were no longer in the correct order in the constructor list. 2019-02-21 09:22:01 -05:00
mcsauder
8a6a5cc310 Deprecate #defines that are not needed, format whitespace and minor (incomplete) alphebetization of a few lists. 2019-02-21 09:22:01 -05:00
Daniel Agar
7c3999e00e update mavlink and sitl_gazebo to latest with odometry velocity covariance 2019-02-10 16:32:59 -05:00
mcsauder
dc5f18bdcd ToneAlarm class refactoring to implement an interface for hardware specific methods and a single ToneAlarm class. 2019-01-28 18:58:04 -08:00
Matthias Grob
504372f551 MAVLink: RC_CHANNELS_OVERRIDE generate correct RC channel count (#11219)
* mavlink_receiver: generate rc channel count
* mavlink_receiver: zero out ignored rc channels, add comments
2019-01-25 12:15:01 -05:00
Julian Oes
5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Roman Bapst
90bfdb6f0a VTOL rate control architecture improvements (#10819)
* attitude and rate setpoint message: use 3D array for thrust demand
* FixedWingAttitudeControl: rework airspeed scaling
  * move airspeed and scaling calculation into separate method
  * if vtol in hover and airspeed disabled use minimum airspeed instead of trim airspeed
2018-11-21 20:32:40 -05:00
Daniel Agar
571364c617 delete baro_report (alias for sensor_baro_s) 2018-11-06 07:43:43 +08:00
Daniel Agar
acc24da0c2 delete gyro_report (alias for sensor_gyro_s) 2018-11-06 07:43:43 +08:00
Daniel Agar
2a83a40491 delete accel_report (alias for sensor_accel_s) 2018-11-06 07:43:43 +08:00
Paul Riseborough
6a3692cf6b mavlink: publish GPS antenna heading offset as NAN 2018-10-17 09:48:38 -04:00
TSC21
3228e494bd radio_status: change 'fixed' field name to 'fix' so it does not clash with 'fixed' floating-point notation on the IDL generation 2018-10-08 10:58:45 +02:00
Beat Küng
403f909e3a mavlink_receiver: simplify sleeptime calculation 2018-10-02 14:14:10 +02:00
Beat Küng
0e1e0b997d mavlink_receiver: reduce s_variance_m_s for HIL GPS message from 1 to 0.1
1 was too high to pass the EKF2 test (EKF2_REQ_SACC which is 0.5 by default)
and thus switching into position mode in HIL was not possible.
2018-09-29 09:17:53 -04:00
Julien Lecoeur
cb3d86a609 Add support for mavlink message DEBUG_FLOAT_ARRAY 2018-09-27 12:33:12 -04:00
MaEtUgR
2c7c876c38 mavlink_receiver: parse all 18 channels from rc_override 2018-09-21 16:26:27 +02:00
MaEtUgR
4f0e090e88 drv_rc_input: replace useless rc_input_values define 2018-09-21 16:26:27 +02:00
garfieldG
f14125c160 Mavlink NuttX network support (#10200) 2018-09-18 23:29:58 -04:00