1304 Commits

Author SHA1 Message Date
Nate Weibley
547592fddf Use a persistent file* and seek less for log download
Opening/seeking/closing the file for each data chunk was extremely
expensive and drastically slowed the download process as the position
in the file increased. Over USB with large files this change + nuttx
update results in ~ 10x speedup for log downloads.
2016-08-03 14:33:01 -04:00
Lorenz Meier
6ab9dc0acf Testing cleanup from Daniel Agar 2016-07-29 13:49:14 +02:00
Beat Küng
2241ab9cac mavlink: add a shell using SERIAL_CONTROL MAVLink message 2016-07-29 13:07:17 +02:00
Sebastian Quilter
3b7ba915a8 small refactor (#5155) 2016-07-28 14:49:37 -07:00
Gus Grubba
c3b58822a8 Fixes to log download (#5133)
* Fixes to log download

* Fixing indentation
2016-07-25 08:15:23 -04:00
Beat Küng
0f6a6f7150 mavlink_messages.cpp: only warn once, when MAVLink log opening fails
This happens for example if no SD card is present.
2016-07-20 13:07:32 +02:00
Beat Küng
9a8c092116 mavlink_messages.cpp: fix coding style: prepend _ to class members 2016-07-20 13:07:32 +02:00
lovettchris
b48c081e5c Reset _transfer_in_progress if mavlink transfer times out. (#5077) 2016-07-15 14:59:30 -07:00
Julian Oes
3ed8b735c2 mavlink: only warn once if broadcast fails
This fixes the issue where the console was spammed if a broadcast failed
after a connection had previously been established.
2016-07-13 19:40:59 +02:00
Julian Oes
eda2915f0b mavlink: whitespace fix 2016-07-13 10:10:45 +02:00
Julian Oes
d9343fa925 mavlink: use new copy_if_updated interface 2016-07-13 10:10:45 +02:00
Julian Oes
8345a0368b mavlink: add function to copy only if updated
The MavlinkOrbSubscription only had an interface to either always copy
or copy based on a timestamp. This commit adds a copy interface if the
topic has been updated.
2016-07-13 10:10:45 +02:00
Daniel Agar
59b4350aa0 implement MAV_CMD_NAV_LOITER_TO_ALT and general mission cleanup 2016-07-12 23:36:05 +02:00
tommises
4fa2c54485 Mocap timestamp cleanup (#5021) 2016-07-11 12:46:29 +02:00
Lorenz Meier
71d150f6ec MAVLink app: Fix rate handling 2016-07-10 17:05:33 +02:00
tommises
d2194d787f Refactored Mavlink stream configuration (#5015)
Streams ordered same way in all modes.
2016-07-10 16:22:22 +02:00
Lorenz Meier
8b3045baa2 MAVLink: clean up vision timestamps 2016-07-10 12:43:47 +02:00
tommises
19b56c1574 Use timestamp received from companion computer as timestamp_boot 2016-07-10 12:29:19 +02:00
tommises
5bd574dd05 Fixed timestamp synchronization 2016-07-10 12:29:19 +02:00
tommises
f69e9a3d37 Fixed VISION_POSITION_ESTIMATE.usec
Fixed units to be microseconds and not milliseconds.
2016-07-10 12:29:19 +02:00
Beat Küng
9c73eae941 sensor_combined: replace accel & gyro integral with value, use float for dt
Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.

Note that this breaks the replay format for sdlog2 replay
2016-07-07 11:35:50 +02:00
Beat Küng
c5ea4b43be sensor_combined.msg: make timestamps relative
This is needed for the new logger & saves some space as well.
2016-07-07 11:35:50 +02:00
Beat Küng
d846ad5dac sensors: move voting into sensors module
- voting is now at a central place instead of duplicated within the
  estimators
  -> this also means that estimators that did not do voting so far,
     now have voting, like ekf2
- estimators requiring more than that can still subscribe to the raw
  sensors
- allows sensors_combined to be 3 times smaller
  - reduces logger, memcpy (cache) & RAM overhead
- all modules requiring only 1 or 2 sensor values now automatically get
  the voted result
- this also adds voting to baro
2016-07-07 11:35:50 +02:00
Beat Küng
b4ecc5a8d9 sensor_combined cleanup: remove many unneeded fields
Decreases the message size from 780 to 280 bytes.
In particular, all modules using sensor_combined must use the integral now.
The sensor value can easily be reconstructed by dividing with dt.

Voters now need to be moved into sensors module, because error count and
priority is removed from the topic.

Any module that requires additional data from a sensor can subscribe to
the raw sensor topics.

At two places, values are set to zero instead of subscribing to the raw
sensors (with the assumption that no one reads them):
- mavlink mavlink_highres_imu_t::abs_pressure
- sdlog2: sensor temperatures
2016-07-07 11:35:50 +02:00
Beat Küng
c407123a72 cleanup sensor_combined: remove adc & differential_pressure fields
These are not really used. differential_pressure is just copied from the
topic with the same name.

for sdlog2 we assume no one needs the diff pressure fields and set it to 0.
We plan to switch to the new logger soon anyway.
2016-07-07 11:35:50 +02:00
Daniel Agar
a9a3050682 EKF2 HIL gps decrease s_variance_m_s 5.0 -> 1.0 (#4973) 2016-07-04 08:18:15 +02:00
Lorenz Meier
972a6f7be8 Fix MAVLink reporting of Firmware version, implement dev / release version reporting 2016-07-02 11:43:24 +02:00
Hidenori
76ee17e532 RC input and PWM output for Navio2 2016-07-01 23:08:17 +02:00
Daniel Agar
050eedc4f8 mavlink publish WIND_COV (#4913)
* mavlink publish WIND_COV

-closes #4678

* px4fmu-v2_default disable logger and sync configs
2016-06-27 16:16:24 +02:00
Henry Zhang
ae6600e48f MAVLink app: fix mavlink forwarding issue. (#4907) 2016-06-25 11:02:01 +02:00
Roman
eabc4647c2 mavlink receiver: fixed unit conversions for current
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-24 08:35:27 +02:00
Roman
f754d23a0f mavlink receiver: fixed computation of cell count
Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-24 08:10:35 +02:00
Beat Küng
f8e9a19889 gps_position: convert uint64 timestamp_time -> int32 timestamp_time_relative
We need to make this timestamp relative to the main timestamp. Necessary
for replay, and saves some space.
2016-06-24 00:22:01 +02:00
Beat Küng
e2a7145379 vehicle_gps_position: remove timestamp_variance & timestamp_velocity (they're not used) 2016-06-24 00:22:01 +02:00
Beat Küng
89f5bd27e8 vehicle_gps_position: use timestamp field instead of timestamp_position
timestamp was unused. This allows to remove timestamp_position.
2016-06-24 00:22:01 +02:00
Roman Bapst
571798c318 Pr external battery monitoring (#4881)
* mavlink receiver: added handling of battery status

handle incoming battery status messages in order to support external
battery monitoring

Signed-off-by: Roman <bapstr@ethz.ch>

* sensor params: added parameter for battery monitoring source

Signed-off-by: Roman <bapstr@ethz.ch>

* sensors: only publish battery status if we don't have external battery
monitoring activated

Signed-off-by: Roman <bapstr@ethz.ch>
2016-06-23 18:41:38 +02:00
Nate Weibley
0551e001e2 Properly reflect flow control state if IOCTL fails (#4873)
The flow control state is improperly reflected as enabled if the arch/HAL rejects an IOCTL to turn it on. Mavlink::enable_flow_control updates _flow_control_enabled only if the IOCTL call does not fail.
2016-06-23 10:17:17 +02:00
Lorenz Meier
b563fae118 Fix request data stream handling 2016-06-22 00:09:13 +02:00
Lorenz Meier
2f113a4ce3 MAVLink: Allow data rate updates 2016-06-21 16:38:53 +02:00
Chris Lovett
847d9ec4f4 Fix code style using Tools/fix_code_style.sh 2016-06-21 10:10:50 +02:00
Chris Lovett
534e10c96a Implement code review feedback. Add get_id_static to MavlinkStream items. Add implementation of MAV_CMD_SET_MESSAGE_INTERVAL, MAV_CMD_GET_MESSAGE_INTERVAL. Add deprecation message to REQUEST_DATA_STREAM. 2016-06-21 10:10:50 +02:00
Chris Lovett
4ef4be2d70 MavlinkReceiver::handle_message_request_data_stream walks into deleted memory when you send the "stop" bit on a stream. It also fails to restart the stream because it deletes the stream when you send the stop command, so restart needs to use stream_list to find the stream again. 2016-06-21 10:10:50 +02:00
Daniel Agar
7bbfa5d94b cleanup px4_custom_mode 2016-06-15 20:35:16 +02:00
Beat Küng
26b7ac3884 mavlink: remove an UDP remote port warning, print remote port in mode info 2016-06-15 09:56:34 +02:00
Daniel Agar
e322359b27 get_mavlink_mode_state remove unused pos_sp_triplet (#4613) 2016-06-10 10:33:56 -04:00
Julian Oes
c95c13985c mavlink: better printf 2016-06-07 22:10:56 +02:00
Julian Oes
00bffeaf72 mavlink: whitespace only 2016-06-07 22:10:56 +02:00
Julian Oes
1dea9433b7 mavlink: don't complain if there is no mission 2016-06-07 22:10:56 +02:00
Julian Oes
67b2f68abd mavlink: improved, updated usage 2016-06-07 22:10:56 +02:00
Julian Oes
ec5b2adfc0 mavlink: don't try broadcast 0, and less printfs
This removes a bunch of unneeded printfs and prevents broadcasting
packets of size 0 which just trigger a warning.
2016-06-07 22:10:56 +02:00