Commit Graph

30749 Commits

Author SHA1 Message Date
Beat Küng
72e62a62cb batt_smbus: make bus_options const and rename to smbus_bus_options
as it is a global name.
2019-11-07 10:56:27 +01:00
Beat Küng
adad11f247 batt_smbus: remove unused defines 2019-11-07 10:56:27 +01:00
Beat Küng
b487920cf4 fix batt_smbus: add bound checks when accessing argv 2019-11-07 10:56:27 +01:00
Beat Küng
60f55a4fa1 fix batt_smbus: check if module running for custom_command 2019-11-07 10:56:27 +01:00
Beat Küng
f63b55b219 fix batt_smbus: do not block the work queue while suspended 2019-11-07 10:56:27 +01:00
Beat Küng
3f3304fefc batt_smbus: variable init cleanup + remove unused declarations 2019-11-07 10:56:27 +01:00
Beat Küng
32359168d6 smbus: fix invalid memory access in read_word()
read_word() expected 3 bytes (uint16_t + PEC byte), but was passed an
address to an uint16_t value.

write_word() is changed to be type-safe as well.
2019-11-07 10:56:27 +01:00
Beat Küng
e772ddf012 motor_test: remove note about supported drivers
This is now supported by all main output drivers.
2019-11-07 10:40:03 +01:00
Beat Küng
6622f04feb uavcan drivers: update code style
Pure refactoring, just running 'make format'.
2019-11-07 10:40:03 +01:00
Beat Küng
6049a95073 uavcan drivers: remove unused code for other OSs/bare metal 2019-11-07 10:40:03 +01:00
Beat Küng
5dff065ec5 uavcan: move to work queue and use MixingOutput
Main UAVCAN protocol handling and ESC updates run on the same thread/wq as
before. There are 2 WorkItems for separate scheduling of the 2, so that
ESC updates run in sync with actuator_control updates. UAVCAN is scheduled
at a fixed rate of 3ms (previously the poll timeout) and on each UAVCAN
bus event.
This leads to roughly the same behavior as before. CPU & RAM usage are
pretty much the same (tested on Pixhawk 4).

Testing done: Motors still work (with feedback), param changes and a
UAVCAN optical flow sensor.
2019-11-07 10:40:03 +01:00
Beat Küng
b7a480b45b refactor uavcan: add stm32 and kinetis drivers directly 2019-11-07 10:40:03 +01:00
Beat Küng
6854b14dd6 esc_report: remove unused fields to reduce message size
esc_setpoint in UAVCAN was just wrong, this is what it really is:
uint7 power_rating_pct      # Instant demand factor in percent
(percent of maximum power); range 0% to 127%.
2019-11-07 10:40:03 +01:00
Beat Küng
0db0981b1b uavcan: remove actuator_direct (no publisher) 2019-11-07 10:40:03 +01:00
Daniel Agar
06f20ad892 sensors: ensure angular velocity publication on selected sensor update 2019-11-07 09:53:44 +01:00
Julian Oes
60343cc168 mavlink: warning for actuator offboard & lockstep
Currently actuator offboard control interferes with SITL lockstep.
Therefore, the least we can do is to warn a user and inform them how to
workaround the issue.
2019-11-06 12:30:30 -05:00
Daniel Agar
02271a471d vscode extensions update cmake-tools (now from microsoft) 2019-11-05 21:13:36 -05:00
JaeyoungLim
b999581d2f Rover: Handle velocity frames correctly for offboard velocity control 2019-11-05 16:29:04 -05:00
Daniel Agar
d263811eef Jenkins move raspi and bebop builds to regular armhf toolchain 2019-11-05 15:56:24 -05:00
Daniel Agar
5ec74af421 ADIS IMU drivers cleanup and standardize main 2019-11-05 11:58:43 -05:00
Matthias Grob
1a79f75f94 Commander: start pulling arming related parts into separate folder
* PreFlightCheck: remove unused reportFailures flag
* Commander: pull all pre flight checks together on the PreFlightCheck class
* PreFlightCheck: separate checks into their own files
2019-11-05 11:25:59 -05:00
Peter van der Perk
08a27492b4 Introduced condition variable in ROS2 subscriber to solve 500ms latency spikes 2019-11-05 15:09:44 +00:00
Julian Oes
ef475fa9d8 mixer_module: fix poll error in SITL lockstep
This fixes the case where the mixer_module would subscribe and use its
own test_motor publication which was created only to make sure the
topic is advertised and subsequent updates will work properly.

This happened in SITL lockstep because the timestamp would be 0 at the
very beginning, and hence elapsed time would be 0 as well.
This lead to an actuator publication which would then get lockstep out
of sync causing poll errors on the Gazebo side.
2019-11-05 09:33:14 -05:00
Matthias Grob
b6de83117e PositionControl: fix attitude setpoint timestamp
The plot of the attitude setpoint in the log did not show any values
because the message timestamp that the position control module sets
was overwritten by the PositionControl attitude generation.
2019-11-05 13:05:16 +01:00
Matthias Grob
c6cc9f0902 mc_pos_control: fix cutting thrust when landed
by applying it directly to the attitude setpoint which is the output of
the position controller.

The problem was that before the input to the attitude setpoint generation
was adjusted to generate a level attitude with zero thrust keeping the
heading. I refactored the PositionControl class in #13262 to directly
generate the attitude setpoint output. So here I'm adjusting the attitude
setpoint to do the exact same thing as before but without interleaving
with the PositionControl logic.
2019-11-05 13:05:16 +01:00
Beat Küng
a203475489 BlockingList: fix unsafe getLockGuard() API
getLockGuard relies on copy elision to work correctly, which the compiler
is not required to do (only with C++17).
If no copy elision happens, the mutex ends up being unlocked twice, and the
CS is executed with the mutex unlocked.

The patch also ensures that the same pattern cannot be used again.
2019-11-05 12:14:20 +01:00
Julian Oes
4ff4f5c77f commander: fix capitalization of mavlink messages 2019-11-05 10:40:30 +01:00
Julian Oes
24c58db9e6 commander: fix battery failsafe without GPS
This fixes the battery failsafe for the following corner cases:
- Battery failsafe set to Return but we can't do RTL because we don't
  have a global position or home position. In this case we now switch to
  Land. Land might end up in Descend in the failsafe state machine
  later.
- Battery failsafe set to Land but we can't land because we don't have a
  local position. In this case we switch to land anyway and then fall
  back to descend in the failsafe state machine later.

The "fix" involves ignoring using the main_state_transition and
implementing the guards in place. This is a hack for now but should
cover the corner case until a more thorough refactor.

The different failsafe state machines have involved over time from
requirements and learnings based on developed solutions and products.
The implementations in various places will need to get consolidated in
the future.

Tested in SITL for Return and Land with and without GPS.
2019-11-05 10:40:30 +01:00
PX4 BuildBot
6e395fe885 Update submodule matrix to latest Tue Nov 5 00:38:36 UTC 2019
- matrix in PX4/Firmware (dca3f78e198f89510890fbb8b305d2fa1c3caa69): 92d1c8761e
    - matrix current upstream: 9f46483951
    - Changes: 92d1c8761e...9f46483951

    9f46483 2019-11-04 Julian Kent - Fix GCC-4.8 bug
445f58d 2019-11-01 Julian Kent - Fix weird C preprocessor conflicts (#101)
215203f 2019-10-23 Julian Kent - Automatic Differentiation 'Dual' Type (#100)
2019-11-04 20:05:43 -05:00
Oleg Kalachev
7b83da708a mavlink_receiver: write STATUSTEXT messages from the same system to log 2019-11-04 15:33:22 -05:00
Matthias Grob
2416d0fc63 mc_pos_control: remove unused function declarations 2019-11-04 15:07:06 -05:00
Daniel Agar
7f930f875e Jenkins store SITL unit test results 2019-11-04 14:04:40 -05:00
Julian Kent
b8b7527d05 Fix off-track tracking in AutoLineSmoothVel (#13321)
* Use position instead of last setpoint

This calculates the target velocities better taking into account disturbances along
the flight route. Previously entry angles and more were calculated assuming the flight path
originates directly from the direction of the previous waypoint. This corrects this assumption
to instead make the direction come from the vehicle location.

* Allow to specify a final speed given a braking distance.

This is to allow planning to not stop at a waypoint, but instead
to reach the waypoint while maintaining a certain velocity

* Updated src/lib/matrix

* Account for speed at target when determining constraints

* Separate constraints into x/y components

* Use setpoint position, not vehicle position

* Fix whitespace, add documentation
2019-11-04 11:57:12 +01:00
Daniel Agar
07825faeff Update submodule mavlink v2.0 to latest Mon Nov 4 00:39:49 UTC 2019 (#13340)
- mavlink v2.0 in PX4/Firmware (64daa96d11): 086f176b67
    - mavlink v2.0 current upstream: 7c0ec61677
    - Changes: 086f176b67...7c0ec61677
2019-11-03 20:27:19 -05:00
Daniel Agar
64daa96d11 Jenkins hardware move to nested stages 2019-11-03 16:31:43 -05:00
Jacob Dahl
005f530eed Removed lidar lite reset after intialization 2019-11-03 20:07:27 +01:00
Daniel Agar
40850f58ee boards cleanup old nsh_archinitialize 2019-11-03 12:09:48 -05:00
Daniel Agar
ee003370c4 UVify Core board sync with px4/fmu-v4
* A few minor changes to keep the UVify Core board in sync with fmu-v4. This will be important when transitioning to the new IMU drivers using SPI DMA (#13103).
2019-11-03 11:51:54 -05:00
Daniel Agar
69bec3ee62 defines.h delete obsolete PRIu64, PRId64, and offsetof 2019-11-03 11:50:15 -05:00
Daniel Agar
7bf9700426 NuttX: math.h drop extra math defines carried in PX4 defines.h 2019-11-03 10:30:00 -05:00
Jaeyoung-Lim
1951e416b1 Enable rover attitude setpoint 2019-11-03 09:54:22 -05:00
FlavioTonelli
7984c0c910 px4_work_queue: stack size rounded to page size on posix 2019-11-03 09:04:04 -05:00
Julian Oes
a08abccdd5 mpu9250: fix mag spikes on fmu-v4pro
This should fix spikes in the mag data on MPU9250 found inside Drotek
Pixhawk 3Pro.

The problem turned out to be that we are not checking the DRDY bit
before reading the data. We presumably threw away most of the stale data
by doing a duplicate check, however, sometimes we might have run into a
race where the mag data was already being updated in the chip while
still being read.
2019-11-02 12:49:30 -04:00
Daniel Agar
3e189889ef FlightTasks: shift DEFINE_PARAMETERS to end of access modifiers
- DEFINE_PARAMETERS includes a private access modifier, so we need to
keep these at the end to prevent issues when extending a flight task
2019-11-02 12:41:45 -04:00
CAI Dongcai
c804dea914 sitl script: Do NOT kill px4 if debug in IDE 2019-11-02 12:40:36 -04:00
Daniel Agar
7a82df3872 UVify Core and Draco-R updates
* Draco-R sensor orientation correction
* LL40LS sensor is not stable during I2C probing. More trials have been implemented.
* px4flow execution has been removed as rc script already running it
* GPS LED script repaired
* Off ICM20608 due to some bug?
* Removed i2c speed adjustment due to SMBUS.
* ms5611 test2 does not exist
* Baud rate has changed.
* Draco-R airframe parameters are updated.
* IFO and Draco parameters are updated
* Draco-R sensor orientation corrected
* Draco-R DSHOT supports
2019-11-02 11:39:41 -04:00
Daniel Agar
a475d71ca9 astyle shift module documentation to bottom of files
- Astyle chokes on the module description strings, so for now we can keep them near the bottom of each file.
2019-11-02 10:58:47 -04:00
PX4 BuildBot
f0ac270174 Update submodule ecl to latest Sat Nov 2 13:49:23 UTC 2019
- ecl in PX4/Firmware (4658aaf8a0ff90662843558dbc8ea68adcc7284d): 9b4b24ee71
    - ecl current upstream: d76b704225
    - Changes: 9b4b24ee71...d76b704225

    d76b704 2019-11-01 kamilritz - Only inlcude gtest if standalone build
7c1e38d 2019-10-18 kamilritz - Make it build with Firmware
d79199c 2019-10-17 kamilritz - Remove swig and python test related things
d88e242 2019-10-17 kamilritz - pytest are replaced in gtests
71be26e 2019-10-17 kamilritz - Port RingBuffer Test to GTests
cac5f3f 2019-10-17 kamilritz - GTest and Coverage cleanup and Basic EKF GTest
fcea13e 2019-10-14 Martina Rivizzigno - add gtest, temp disable swig
2019-11-02 10:48:45 -04:00
Matthias Grob
cc06009932 pre-commit: fix indentation style 2019-11-02 09:49:46 -04:00
Matthias Grob
5c0692e59e pre-commit: add error messages for style issues 2019-11-02 09:49:46 -04:00