Commit Graph

12131 Commits

Author SHA1 Message Date
Daniel Agar 2ad12d7977 sensors: create vehicle_angular_velocity module (#12596)
* split out filtered sensor_gyro aggregation from mc_att_control and move to wq:rate_ctrl
2019-08-06 12:55:25 -04:00
Daniel Agar 6f2d1d55f6 logger use uORB::PublicationQueued for ulog_stream
- queue depth is now set by the msg
2019-08-06 11:07:59 -04:00
Daniel Agar 5b511eaa1a logger move non-logged subscriptions to uORB::Subscription 2019-08-06 11:07:59 -04:00
garfieldG d3ba9c59e0 mavlink: added check if instance mode is serial when trying to find if instance exists (#12642) 2019-08-06 10:53:07 -04:00
Daniel Agar 8f5b7de498 uORB::Subscription minor API cleanup
* the forceInit() method was combined with the existing subscribe()
 * delete unused last_update()
2019-08-06 10:28:49 -04:00
Martina Rivizzigno e0893c383d increase mc_pos_control stack from 1300 to 1500 2019-08-05 16:05:40 +02:00
Martina Rivizzigno 39e59d6cc4 add point type (mavlink command associated with wp) in Obstacle Avoidance interface 2019-08-05 16:05:40 +02:00
Andrei Korigodski 4d5f922e7a commander: use shutdown_if_allowed() to check for shutdown safety
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Andrei Korigodski 5133453822 vehicle_status: replace ARMING_STATE_REBOOT with ARMING_STATE_SHUTDOWN
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Andrei Korigodski 4a330c6e0a commander: do not reboot on USB disconnect when armed
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
mcsauder 2e3926b577 Fix a corner case that prevented mavlink config streams from being indexed appropriately when USB is not connected at boot.
Break out Mavlink class constructor logic into set_instance() and set_channel() methods. and add const specifiers and default arguments to Mavlink::mavlink_open_uart().
2019-08-05 05:02:20 -07:00
Matej Frančeškin 3d993773ae Mavlink FTP: Fix for wrong component id in retry 2019-08-05 13:51:10 +02:00
RomanBapst 43d006aff2 mavlink command sender: give channels more time to request command
- if a channel receives an ack for a command, do not immediately remove the
command item from the send queue but wait until the next ack timeout occurs.
This gives other mavlink channels time to try to put identical commands into
the send queue.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-08-05 12:07:05 +02:00
RomanBapst 71791fa8f8 mavlink_command_sender: don't try to resend command to instance which
did not request this command

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-08-05 12:07:05 +02:00
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 34598fe353 mavlink uavcan parameters initialize value 2019-08-03 15:05:34 -04:00
Daniel Agar 483280236b mavlink use all ORB battery_status instances instead of BOARD_NUMBER_BRICKS 2019-08-03 13:36:42 -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 39a5799e65 Mavlink: fixed temperature for batteries (#12605) 2019-08-02 10:09:03 -04:00
Matthias Grob d0f1a551e9 manual_contol_setpoint: fix mode slot numbering (#12578)
* This fix is necessary because usually uORB structs get initialized with
all zeros and then get filled with the fields that are actually in use.
 * The number 0 for the mode slot was already commanding to switch to the
mode in slot one even though for example the joystick input via mavlink
does not use this mechanism at all.
2019-08-01 12:27:58 -04:00
Daniel Agar bc9fb26ccd commander esc_calibration move to uORB::Subscrition 2019-07-31 20:30:05 -04:00
Burak Saruhan 7789e2de88 sensors: mag reload calibration parameters when first seen (#12586)
* fixes UAVCAN MAG calibration application after reboot
2019-07-31 15:22:59 -04:00
Matej Frančeškin 1600b0fd82 Mavlink FTP - return ENOENT when directory doesn't exist (#12589) 2019-07-31 15:22:46 +02:00
Daniel Agar 0e949a36ee task_stack_info increase task_name length to match NuttX CONFIG_TASK_NAME_SIZE 2019-07-30 10:47:10 -04:00
RomanBapst b75d2ce982 set trajectory generating flight task as default (MPC_POS_MODE = 3)
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-29 10:37:26 -04:00
RomanBapst a8071589bc increase default fixed wing rate controller I term
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-29 10:37:26 -04:00
RomanBapst 77fd290b0c added default expo for yaw and x/y/z velocity demand in position mode
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-29 10:37:26 -04:00
RomanBapst 81ae85015f changed defaults of MPC acceleration limit parameters
- vehicle will fly less aggressive
- it does not make sense to set the lower acceleration limit to something
that exceeds gravity if most of the vehicles do not support reverse thrust

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-29 10:37:26 -04:00
RomanBapst a5d3e10c67 MPC_MAN_Y_MAX: changed default from 200 to 150 deg/s
- we have set the maximum yaw-rate MC_YAWRATE_MAX to 200 degrees and it
makes senses to leave a bit of margin between what the user can demand
and what the limits of the vehicle are

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-29 10:37:26 -04:00
RomanBapst f0cdd9be60 MPC_Z_VEL_I: changed default from 0.02 to 0.1
- generally better attitude tracking
- much better altitude control immediately after takeoff (hover throttle offset)
- faster landing detection

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-29 10:37:26 -04:00
Daniel Agar be99d2f111 sih: fix code style 2019-07-28 11:18:02 -04:00
Daniel Agar 09eaef82f6 sih: move to PX4Accelerometer/PX4Gyroscope/PX4Magnetometer/PX4Barometer helpers 2019-07-28 11:18:02 -04:00
Daniel Agar 97445b60aa commander preflightcheck update orb usage to uORB::SubscriptionData 2019-07-28 10:22:47 -04:00
TSC21 3d9f83a4f2 microRTPS_bridge: structural change to make possible to generate pub/sub code for multi-topics/aliased msgs 2019-07-26 15:05:54 +02:00
Julian Oes 98dfa30838 commander: fix disarming for rovers
We have to ignore the landed flag for rovers, it doesn't really apply
for them.
2019-07-26 02:52:38 -07:00
Julian Oes 308d91e5ff commander: prevent potential disarms in-air
This fixes the terrifying case where the drone disarms in-air just
because it receives a MAVLink disarm command. We now check param2 for a
magic number which enforces arming/disarming.

This is added to the mavlink protocol in:
https://github.com/mavlink/mavlink/pull/1162
2019-07-26 02:52:38 -07:00
Timothy Scott 80f2603b17 Fixed timing of rover pos control 2019-07-25 10:53:39 -04:00
Beat Küng 72ddf3e0aa tune_control: use orb queue advertisement consistently 2019-07-25 10:38:57 -04:00
David Sidrane e296297ab7 Revert "hotfix for logger: use '%i' instead of '%zu'"
This reverts commit e6aa035209.
  Root cause was fixe in Nuttx and backported
2019-07-25 05:28:46 -07:00
Hamish Willee 2b8337e5e2 Add units for EKF2_RNG_A_HMAX and EKF2_RNG_A_VMAX (#12545) 2019-07-25 08:09:35 +02:00
RomanBapst 2fbb70d9ca mc_att_control: output zero throttle in manual mode when landed
- MPC_MANTHR_MIN is used as minimum throttle in attitude control mode when
the vehicle is in air. This is useful to retain some control around roll and
pitch axis if airmode is not enabled and the user demands zero throttle.
However, when the vehicle is landed there is not need to keep the throttle
at a higher value than zero.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-23 17:12:45 +02:00
Timothy Scott 2ed8ebf889 rover_pos_control: refactor to ModuleBase and use C++ Param API 2019-07-23 11:16:52 +02:00
Matthias Grob e964af9262 commander_params: enable RC override by default
It doesn't affect fixed wing flying anymore. I disabled it for the
deltaquad since I presume @sanderux prefers to have the feature disabled
even when flying in multicopter mode.
2019-07-22 09:57:37 +02:00
Matthias Grob 706500f19c Commander: make RC override multicopter only
AAs discussed in the devcall this functionality is only useful for
rotary-wing (multicopter) flying since it's a big safety hazard to
accidentally bring a fixed wing out of an auto mode e.g. a mission
and fly away in a straight line or into an obstacle.
2019-07-22 09:57:37 +02:00
Matthias Grob 5c1ab06343 Commander: pure refactor of RC override conditions 2019-07-22 09:57:37 +02:00
Matthias Grob aaad71faab commander_params: enable automatic disarming after land detection by default 2019-07-18 14:36:50 +02:00
Daniel Agar 9986a88697 mavlink: split BATTERY_STATUS from SYS_STATUS update and handle all bricks (#12034) 2019-07-18 13:32:41 +02:00
Timothy Scott ecf396443f Minor bugfix 2019-07-17 10:47:56 +02:00