9746 Commits

Author SHA1 Message Date
sanderux
49d2e8a3ff Land detector fix for VTOL in FW mode 2017-08-09 08:12:54 +02:00
Beat Küng
72f9371ca4 micrortps_client_main: remove unnecessary sleep(1);
... and some strange reformatting due to astyle...
2017-08-08 21:47:17 +02:00
Beat Küng
de8e0b54b6 micrortps_client_main: use new module documentation & check param range 2017-08-08 21:47:17 +02:00
Beat Küng
e7d19f0a1a micrortps_client_main: add status command 2017-08-08 21:47:17 +02:00
José Roberto de Souza
925efe990d Initialize all outgoing vehicle_command_ack_s and vehicle_command_s
This will initialize those structs with zero in all fields not set
and all fields set will only be change once to the final value not
wasting CPU time zeroing it.

This will guarantee that no non-unitialized structs will have
a trash value on from_external causing it to be sent to the
MAVLink channel without need it.
2017-08-08 21:46:30 +02:00
José Roberto de Souza
7c268f4fa1 mavlink: Safely avoid send the same vehicle_command and vehicle_command_ack back
The previous approach was checking system id and component id but it
will not work in 100% of cases as external devices can send MAVLink
message with the right system id but with broadcast component id.
2017-08-08 21:46:30 +02:00
José Roberto de Souza
89a428fbfe commander: Keep vehicle_command_ack_s local
No need to keep this struct as global or alive while looping.
2017-08-08 21:46:30 +02:00
José Roberto de Souza
7082cc13e0 mavlink: Allow vehicle to receive a command_ack message and publish it to listeners 2017-08-08 21:46:30 +02:00
José Roberto de Souza
a8cfd6f36a msg: Use the correctly data types on vehicle_command
Lets save a few bytes using the right data types.
2017-08-08 21:46:30 +02:00
Peter Duerr
453937a89a Fix va_arg calls (always call va_end)
From the manpage: "Each invocation of va_start() must be matched by a
corresponding invocation of va_end() in the same function."
2017-08-07 22:05:54 +02:00
Peter Duerr
40dff737c5 Fix uninitialized values identified by cppcheck
* Replace `malloc` by `calloc` for c-string initialization
* Add initializer braces for structs
2017-08-07 22:05:17 +02:00
Peter Duerr
cc1b766824 Fix memory leaks identified by cppcheck
* Add `free` / `delete`
* Add comment explaining the (presumed) motivation for the use of new instead of
  allocating on the stack
2017-08-07 22:05:17 +02:00
Vicente Monge
0a61e9b279 micro RTPS CMakeLists.txt identation 2017-08-07 12:00:35 +02:00
Vicente Monge
a93174dee4 Fix for manual/automatic micro RTPS bridge generation 2017-08-07 12:00:35 +02:00
Vicente Monge
d1e39ed9e0 Added link to documentation and suppress local doc 2017-08-07 09:46:56 +02:00
Lorenz Meier
490f40bee1 Sensors: Use temperature for airspeed validation to avoid false positives for high-performance airspeed sensors
This is required to enable new high-performance sensors which otherwise would provide incorrect readings.
2017-08-06 20:52:37 +02:00
Sander Smeets
c81dd46b02 land detector VTOL inherit MC maybe_landed (#7738)
* maybe_landed state for VTOL inherited from MC
* set correct land detector for SITL
2017-08-06 10:02:56 -04:00
Beat Küng
a2ef611a30 dataman: improve error reporting 2017-08-04 18:08:51 +02:00
Beat Küng
45e185f8e3 mavlink: document verbose command 2017-08-04 18:08:51 +02:00
Beat Küng
843cb05ef4 mavlink_mission: fix send_mission_count: must always use MAV_MISSION_TYPE_MISSION
Because it's only used for missions
2017-08-04 18:08:51 +02:00
Beat Küng
34e31641ab mavlink_mission: print mission_type on clear_all verbose output 2017-08-04 18:08:51 +02:00
Beat Küng
25cc64947a mavlink_mission: add check for fence & safe point on regular mission upload 2017-08-04 18:08:51 +02:00
Beat Küng
b1730b67e4 mission: keep 'offboard mission updated' printf as a warning
Useful to see when a in-flight mission update happens from the log.
2017-08-04 18:08:51 +02:00
Beat Küng
fde1c061ed fix mavlink_mission: mission_set_current message only applies to MISSION_TYPE_MISSION
and thus the current _mission_type does not matter.
2017-08-04 18:08:51 +02:00
Beat Küng
6d85a3c4e4 geofence: lock geofence items during a write transfers
- avoids race conditions when geofence data is updated in flight. During
  a transfer, the geofence module will not check for violations, which
  is done with the new dm_trylock method.
- there is an update counter stored in dataman, and for each write
  transaction this is increased, so that the geofence module can reload
  the data upon data change (after it's unlocked).
- single dm item updates are atomic already, so resetting the polygons
  to 0 does not need locking.
2017-08-04 18:08:51 +02:00
Beat Küng
cb580c5268 navigator/mission.cpp: check result of dm_lock
and remove duplicated output, mavlink_log_critical already outputs to the
console
2017-08-04 18:08:51 +02:00
Beat Küng
3d3e6428c2 msg/geofence_update.msg: remove this topic
We'll use dataman to check for geofence data updates.
2017-08-04 18:08:51 +02:00
Beat Küng
72501df88e dataman: add dm_trylock & add lock for FENCE_POINTS items 2017-08-04 18:08:51 +02:00
Beat Küng
ed478f40fd geofence: implement circular areas 2017-08-04 18:08:51 +02:00
Beat Küng
6667b6434b mavlink_mission: replace warnx, add mission_type to verbose output 2017-08-04 18:08:51 +02:00
Beat Küng
cf3b068179 mavlink: add 'verbose [on|off]' command 2017-08-04 18:08:51 +02:00
Beat Küng
371586be2c MAVLink: Add verbose command 2017-08-04 18:08:51 +02:00
Beat Küng
32491626b6 mavlink mission: set mission_type in mavlink_mission_count_t message 2017-08-04 18:08:51 +02:00
Beat Küng
401d6a1a6f navigator status: print how many polygons there are currently loaded 2017-08-04 18:08:51 +02:00
Beat Küng
4c1328483d geofence: disable altitude check if not configured
It currently cannot be configured via mavlink mission protocol.
2017-08-04 18:08:51 +02:00
Beat Küng
2981ece921 geofence: do not show an error for MAV_FRAME_GLOBAL_RELATIVE_ALT{,_INT} items
Since the altitude is not used, we can ignore this as well.
2017-08-04 18:08:51 +02:00
Beat Küng
e52491c023 geofence: there is no altitude for geofence vertices, remove the TODO 2017-08-04 18:08:51 +02:00
Julian Oes
0ed29192b8 mavlink_mission: don't reset vertex_count
Since vertex_count is in a union with do_jump_current_count, we can't
always reset the current count, otherwise the vertex_count ends up being
0.
2017-08-04 18:08:51 +02:00
Beat Küng
c4cdaa48e0 dataman, mission_feasibility_checker: remove unneeded uorb includes 2017-08-04 18:08:51 +02:00
Beat Küng
82716012bd geofence_update.msg: notify navigator on geofence update 2017-08-04 18:08:51 +02:00
Beat Küng
328e84117e navigator geofence: switch to new dataman data structure, support multiple polygons
This also removes the 'navigator fence <lon> <lat>' command to simplify
code (I don't think there's still use for that anymore). However the
file loading is still supported.

If goefence.txt does not exist, navigator will not clear the geofence
anymore on startup.
2017-08-04 18:08:51 +02:00
Beat Küng
a987886ca3 mavlink: add fence & rally to protocol capabilities 2017-08-04 18:08:51 +02:00
Beat Küng
54d8e245c0 mavlink_mission: fix dm_read check
... and init to 0 is not needed, since already done in constructor
2017-08-04 18:08:51 +02:00
Beat Küng
b9cddfb75b dataman: account for new geofence & rally point structs 2017-08-04 18:08:51 +02:00
Beat Küng
b8fb8c610e mavlink_mission: implement geofence & rally point protocol
- retrieve & store the geofence & rally point data from/to dataman
- interleaved transmissions (of different types) are not possible. trying
  to do so will NACK the new transmission
- only one storage backend for polygons & rally points (not alternating
  between 2 as the mission does)
2017-08-04 18:08:51 +02:00
Beat Küng
40c696ff49 navigation.h: add dataman structs for fence & save points 2017-08-04 18:08:51 +02:00
Beat Küng
65e0d63ba6 commander: avoid duplicated publish, cleanup log output for offboard_mission update
- orb_advertise already publishes a struct, no need for orb_publish
- mavlink_log_critical goes to the console too
2017-08-04 18:08:51 +02:00
Beat Küng
7206bf86dc navigator mission: fix printf log levels 2017-08-04 18:08:51 +02:00
Beat Küng
52ca49c682 geofence: remove fence & fence_vertex messages
- this was never read
- it was implemented wrong, leading to memory access violations in
  publishFence (an integer was passed instead of the fence_s struct)
2017-08-04 18:08:51 +02:00
Lorenz Meier
b82975f73d UAV CAN ESC: Use new task header 2017-08-02 21:18:35 +02:00