Commit Graph

19863 Commits

Author SHA1 Message Date
Lorenz Meier 5899ce715d Navigator: Leverage overlapping fields in logic to save RAM by makeing them overlap in memory as well 2016-10-23 16:26:03 +02:00
Julian Oes 4160b65edb navigator: change default min takeoff alt to 2.5m
Fixedwing aircraft will override this with fw.defaults anyway.
2016-10-23 16:25:15 +02:00
Julian Oes 82f27884df navigator: fix wrong altitude after takeoff
This change fixes a wrong behaviour when a takeoff command is sent.

An example:
- MIS_TAKEOFF_ALT set to 10 meters
- Takeoff command with alt setpoint of 2 meters

Old behaviour:
1. Climb to 10 meters -> takeoff WP reached
2. Go to setpoint at 2 meters

New behaviour:
1. Climb to 10 meters and stay there but notify that altitude was
   overridden.
2016-10-23 16:25:15 +02:00
Julian Oes 032f4df3de mc_pos_control: revert gain change 2016-10-23 16:25:15 +02:00
Julian Oes dcd0df7d02 navigator: fix typo 2016-10-23 16:25:15 +02:00
Julian Oes 4f5fa50efb navigator: fix takeoff jump edge case
In the normal sitl `commander takeoff` case, the takeoff jump was never
actually carried out because the default altitude radius is set to 3m
and the takeoff altitude to ~2m which means that the takeoff waypoint is
"reached" immediately.

This works around this edge case by using the altitude between the home
altitude and takeoff altitude divided by 2 as a acceptance radius.
2016-10-23 16:25:15 +02:00
Julian Oes 72e46e7ed0 mc_pos_control: jump quicker
In SITL, it still takes a while until a vehicle lifts off, so it seems
sensible to raise this jump gain a bit.
2016-10-23 16:25:15 +02:00
Julian Oes ff415a4f1d mc_pos_control: correctly initialize landed state
Since orb_copy is guarded with a orb_check, we ended up not having the
corrent landed state in the beginning which could lead to some
unexpected behaviour on takeoff.
2016-10-23 16:25:15 +02:00
Pavel Kirienko 3a332bb11a Printing all online nodes within UAVCAN status output. This feature increased memory footprint by about 150 bytes. 2016-10-23 15:26:10 +02:00
Pavel Kirienko 9b0ab83f9b Fixed misuse of the preprocessor 2016-10-23 15:26:10 +02:00
Pavel Kirienko eff6a7b5d0 get_next_active_node_id() - starting from 0 2016-10-23 15:26:10 +02:00
Beat Küng 9448e0d673 vdev: remove wrong comment 2016-10-23 15:25:20 +02:00
Beat Küng f7d8612bc9 logger: enable all backends by default
This requires ~270B more RAM
2016-10-23 15:25:20 +02:00
Beat Küng 7c6d99d30f BlockParam: remove _extern_address and create a new class BlockParamExt for this
In most cases, _extern_address was unused, thus wasting cycles & RAM. This
adds a separate class BlockParamExt with the field and uses it in ekf2_main

Frees roughly 0.5KB of RAM on Pixracer
2016-10-23 15:25:20 +02:00
Beat Küng 09d8e4fd8c logger: reduce stack size, which got freed in 05a771152520
commit msg: 'logger: avoid uORB::Subscription, directly use orb_subscribe() instead'
2016-10-23 15:25:20 +02:00
Beat Küng 1bdad65849 uorb: reduce RAM usage by avoiding string copies
The lifetime of the string is guaranteed because we never delete
DeviceNode objects and the strings in question are already on the heap.

This frees roughly 2.2KB of RAM on Pixracer
2016-10-23 15:25:20 +02:00
Beat Küng 4da2ae2302 MavlinkOrbSubscription: optimize fields for size
reorder & reduce instance to uint8_t (which is more than enough).
Reduces sizeof(MavlinkOrbSubscription) from 40 to 24.

On Pixracer this frees almost 2KB of RAM
2016-10-23 15:25:20 +02:00
Beat Küng c50e4a6e21 uORB::DeviceNode: reduce the size of some members
The limits the maximum queue size to 255, which I think is ok for the
forseable future.

sizeof(uORB::DeviceNode) is reduces from 128 to 112 on NuttX, and with
~80 instances, this saves over 1KB of RAM.
2016-10-23 15:25:20 +02:00
Beat Küng 03c12c4c78 Device: use uint16_t for _open_count instead of int (save space) 2016-10-23 15:25:20 +02:00
Beat Küng a5e6f3213f Device: remove _irq_attached flag, test with _irq == 0 instead 2016-10-23 15:25:20 +02:00
Beat Küng 64df463a85 logger: avoid setting the interval for topics where not needed
Saves some RAM, although not much in that case. But all subscriptions
combined need ~1.5KB only for the interval data within uORB.
2016-10-23 15:25:20 +02:00
Beat Küng 7140914d38 logger: remove LoggerSubscription::time_tried_subscribe
Instead use a single timestamp for subscription checks. This frees up
~800B of RAM.

Also make sure the subscription checks are distributed over time. On each
update, at most 1 topic subscription is checked. Reduces the load of the
logger from 7.3% to 5.8% (Pixracer)
2016-10-23 15:25:20 +02:00
Beat Küng f244a78368 logger: avoid uORB::Subscription, directly use orb_subscribe() instead
This frees up ~160B stack size
2016-10-23 15:25:20 +02:00
Beat Küng 4120cd93df logger: make sure structs are properly aligned
ulog_message_info_header_s *msg = reinterpret_cast<ulog_message_info_header_s *>(buffer);
members of msg could end up unaligned, because of the uint8_t buffer.
2016-10-23 15:25:20 +02:00
Lorenz Meier 296b07f9d8 Update Gazebo plugin to fix plane model 2016-10-23 14:21:50 +02:00
Julian Oes 3aa9a72562 mavlink_shell.py: default to 57600 baudrate 2016-10-23 14:00:29 +02:00
Paul Riseborough 06ad477847 ekf2: publish vibration metrics 2016-10-22 12:03:05 +02:00
Paul Riseborough 79ec263b1e msg: Change definition for un-used vibration monitoring variable
Makes the message more useful in comparing the types of vibration likely to cause numerical errors and matches the update ecl library interface.
2016-10-22 12:03:05 +02:00
Paul Riseborough 6a3b147477 ecl: update library reference
Adds reporting of IMU coning and high frequency vibration levels
2016-10-22 12:03:05 +02:00
David Sidrane a2ad92b2d7 Bugfix: Hard Fault hmc5883 with not params
Fault results from if (!strcmp(verb, "start")) {``` with null verb
2016-10-22 11:54:38 +02:00
David Sidrane bdfb2bbb8d Fixed hardfault on fast proc
_baro_topic can be null in init sequence
   init call collect before the topic is inited.

I think this pattern is repeated in other drivers. I would suggest
allowing null in orb_publish to just return.
2016-10-22 11:43:22 +02:00
Siddharth Bharat Purohit b75ff417ea fmu: fix typo introduced in 78b0d1a which adds PWM1 mode 2016-10-22 08:37:13 +02:00
Carlo Wood 6fc30c76a6 Clean up of app.h
app.h, generated from app.h_in, has unnecessary code duplication
and isn't a header file (it defines globals, static functions
and doesn't have a header guard, moreover, it has a 'using namespace
std;'). Because of this, a real headerfile that declares the stuff
defined in apps.h was missing leading to even more code duplication:
scattered forward declarations in .cpp files and an often repeated
type of std::map<std::string, px4_main_t>.

This patch moves cmake/qurt/apps.h_in to src/platforms/apps.cpp.in
(with some changes) and removes cmake/posix/apps.h_in.
Then src/platforms/apps.cpp.in is split into src/platforms/apps.cpp.in
and src/platforms/apps.h.in, splitting declarations from definitions.

A typedef is defined for the map (apps_map_type).

The main difference between cmake/posix/apps.h_in and
cmake/qurt/apps.h_in was that the first defined a global 'apps',
while qurt stores the apps in QShell. I opted to get rid of
the global variable (which are in general evil for various reasons)
and used the API of cmake/qurt/apps.h_in where a provided 'apps'
map is initialized with a call to init_app_map. Thus removing
the existing code duplication.
2016-10-22 08:31:14 +02:00
Daniel Agar c200ef88ed travis-ci, circleci update to GCC 4.9 and 5.4 2016-10-20 22:01:53 -04:00
Julian Oes d57e9f13d7 px_uploader.py: catch exception in except block
This could lead to an exception if serial is not available.
2016-10-20 23:18:56 +02:00
Julian Oes d1822699a9 px_uploader.py: remove unused variable 2016-10-20 23:18:56 +02:00
Julian Oes a14c565ab1 px_uploader.py: trailing whitespace 2016-10-20 23:18:56 +02:00
Julian Oes 78b0d1a01f tap: add landing gear capability
This configures the PWM output for the landing gear.
2016-10-20 23:17:05 +02:00
Julian Oes 2fff2ab9ac Add switch for landing gear, pass it to actuators 2016-10-20 23:17:05 +02:00
Beat Küng 10c4ec2e1a update gps submodule 2016-10-20 21:12:11 +02:00
Beat Küng 0002e86b6f jmavsim_run.sh: add additional arguments for HITL 2016-10-20 18:54:47 +02:00
Beat Küng 7ed81e5edb simulator_mavlink: send MAV_CMD_SET_MESSAGE_INTERVAL to enable ground truth 2016-10-20 18:54:47 +02:00
Beat Küng 7415d94e12 mavlink: don't publish HIL_CONTROLS in HIL mode
it generates unnecessary load. If really needed, it can still be enabled
manually.
2016-10-20 18:54:47 +02:00
Daniel Agar 3fda48517d travis-ci git clone depth 1000 2016-10-19 20:31:56 -04:00
Lorenz Meier 7b2898eaee Fix merge collision 2016-10-19 18:29:34 +02:00
Lorenz Meier 3f5f74399e Increased SBUS buffer size for more reliable SBUS and DSM parsing 2016-10-19 15:32:30 +02:00
Lorenz Meier f7f406c45d Expand RC test to 2nd receiver with 12 channels 2016-10-19 15:31:54 +02:00
Lorenz Meier 6f7a5cdf9b Add additional DSM test data 2016-10-19 15:31:54 +02:00
Beat Küng 210b5704a9 px4fmu_common rcS: fix MAVLINK_F test
fixes a 'test: syntax error' message on startup. There were two problems:
- the expansion of $MAVLINK_F lead to multiple arguments in the test
  when the variable contained spaces. Fixed with ""
- the x prevents interpretation as a unary expression, if $MAVLINK_F starts
  with a - character (in that case the expansion would be:
  if [ -r 1200 ... and nsh interprets - as unary expression)
2016-10-19 15:27:09 +02:00
Beat Küng 3bb479f72e ulog mavlink: use the px4_sem calls (needed for OSX) 2016-10-19 13:13:47 +02:00