Commit Graph

165 Commits

Author SHA1 Message Date
Lucas De Marchi
fbe0d9761c global: use static method to construct AP_OpticalFlow 2017-09-26 03:01:21 +01:00
Lucas De Marchi
5ec1430726 APMrover2: use static method to construct AP_Arming_Rover 2017-09-26 03:01:21 +01:00
Lucas De Marchi
b36a5919f5 global: use static method to construct AP_Mission
This also move the initialization to be in the header for those that
weren't already to maintain consistency.
2017-09-26 03:01:21 +01:00
Lucas De Marchi
40fd1b346c global: remove rangefinder from AP_AHRS_NavEKF
AP_AHRS_NavEKF doesn't use the rangefinder, it just delegates the
calls to the right estimator.

For libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp the initialization
order has also been modified to match the order on vehicles. It's more
correct since it passes a reference when EKF2/EKF3 are already
constructed, while thos constructors use a pointer.  Ideally these
should be moved to an init() method though, or use a get_instance().
2017-09-26 03:01:21 +01:00
Lucas De Marchi
9027a55696 global: use static method to construct RangeFinder 2017-09-26 03:01:21 +01:00
Lucas De Marchi
62ac0ab8aa global: use static method to construct AP_Notify 2017-09-26 03:01:21 +01:00
Lucas De Marchi
de680dac5b global: use static method to construct AP_Scheduler 2017-09-26 03:01:21 +01:00
Lucas De Marchi
8094482f21 global: use static method to construct AP_GPS 2017-09-26 03:01:21 +01:00
Lucas De Marchi
87b30b4552 global: use static method to construct AP_InertialSensor 2017-09-26 03:01:21 +01:00
Lucas De Marchi
c1a957fbf3 global: use static method to construct Compass 2017-09-26 03:01:21 +01:00
Lucas De Marchi
91feec0e14 global: use static method to construct AP_Baro 2017-09-26 03:01:21 +01:00
Lucas De Marchi
0c49b7a973 APMrover2: move version to a static member
We should never include version.h or ap_version.h headers directly
on a header since this will trigger a complete rebuild of the
codebase when we commit to the repository. The ap_version.h header
is auto-generated containing information from the current commit.

If we include it in a header, every other file that ends up including
that header (directly or indirectly) will need to be rebuilt. No
ccache's cache beats having to do nothing when the header is just
not included.

version.h contains information that is kept on a struct inside
each vehicle. Rather than using the macros from each vehicle,
the getter should be preferred, which returns an AP_FWVersion
referente.
2017-09-23 21:37:45 -07:00
Randy Mackay
894bf2a23f Rover: support SET_GPS_GLOBAL_ORIGIN message 2017-09-19 10:30:15 +09:00
Peter Barker
25a32c93f2 Rover: move gcs_out_of_time into GCS object 2017-09-12 18:28:07 +01:00
Peter Barker
d98c427514 Rover: add constant structure holding firmware version 2017-08-30 15:54:46 +01:00
Randy Mackay
1600823b12 Rover: aux switch to learn cruise throttle and speed 2017-08-25 14:05:23 +09:00
Randy Mackay
14c74a5967 Rover: remove learning mode
saving waypoints can be done in manual or steering mode
2017-08-25 14:05:23 +09:00
Randy Mackay
524fe4cd82 Rover: aux switch saves waypoint in manual or steering modes
Also refactor aux switch methods
rename LEARN_CH to AUX_CH
2017-08-25 14:05:23 +09:00
Randy Mackay
82e61d7198 Rover: remove unused throttle_failsafe_active method 2017-08-25 14:05:23 +09:00
khancyr
4ab11027a7 Rover: remove unused mavlink_delay(uint32_t ms) 2017-08-24 20:41:16 +09:00
khancyr
ed19db7188 Rover: set_mode arg name to match implementation
definition and implementation used different argument name
2017-08-17 09:46:19 +09:00
Randy Mackay
492fe40f93 Rover: re-organise private member declarations
declarations are grouped by file (which are in turn organised alphabetically) and in the order they appear within each file
non-functional change
2017-08-15 20:47:19 +09:00
Randy Mackay
6c7db05207 Rover: re-organise includes
non-functional change
2017-08-15 20:47:19 +09:00
Randy Mackay
0b917cfd36 Rover: mode auto guided and rtl slow before destination
new mode class member _desired_speed_final holds target speed at destination

main vehicle code passes heading to next waypoint into auto mode.
we do not provide heading when delaying at waypoint which signals we wish

auto-mode calculates final speed at destination which allows vehicle to
make turn within value of WP_OVERSHOOT parameter assuming vehicle turns at
maximum lateral acceleration.
2017-08-15 20:47:19 +09:00
Randy Mackay
d99108f3bc Rover: use AR_AttitudeControl for throttle control
also direct throttle nudge replaced with speed nudge
calc_speed_max estimates vehicle's top speed based on cruise-speed and
cruise-throttle
steering mode now provides total target speed instead of using speed plug
throttle nudge
motor limits provided to attitude control to stop i-term buildup
uses negative desired speed instead of reversed flag
reporting to GCS uses new throttle controller
braking is simply enabled and allows a reverse motor output regardless of vehicle
speed
2017-08-15 20:47:19 +09:00
Randy Mackay
9097269d6d Rover: use AR_AttitudeControl for steering control 2017-08-15 20:47:19 +09:00
Peter Barker
fa2b500e93 Rover: remove CLI 2017-08-14 10:23:50 +09:00
Randy Mackay
59a1f260d1 Rover: remove unused compat.h 2017-08-12 14:46:46 +09:00
Randy Mackay
bff74115bc Rover: remove unused distance_past_wp 2017-08-12 13:05:01 +09:00
Randy Mackay
30852d4713 Rover: auto-reversed moved to mode 2017-08-05 11:20:58 +09:00
Randy Mackay
66f1437e4f Rover: remove unused throttle variable 2017-08-05 11:20:58 +09:00
Randy Mackay
e88b1572b6 Rover: remove navigate 2017-08-05 11:20:58 +09:00
Randy Mackay
fe6465b748 Rover: remove next_WP, wp_distance, navigate
Also remove prev_WP, wp_totalDistance which are all handled within mode class
2017-08-05 11:20:58 +09:00
Randy Mackay
b4af441eb9 Rover: remove unused update_navigation 2017-08-05 11:20:58 +09:00
Randy Mackay
2640ec9ed9 Rover: rename update_commands to update_mission 2017-08-05 11:20:58 +09:00
Randy Mackay
56b0621994 Rover: verify_RTL calls rtl mode
also remove unused rtl_complete
2017-08-05 11:20:58 +09:00
Randy Mackay
1b19ee865d Rover: remove active-loiter and set-auto-wp
these are now handled by auto mode
2017-08-05 11:20:58 +09:00
Randy Mackay
974453607e Rover: replace do-yaw with nav-set-yaw-speed 2017-08-05 11:20:58 +09:00
Randy Mackay
b9db9229d9 Rover: replace vehicle code guided methods with calls to guided mode class
set_guided_WP replaced by mode_guided.set_desired_location
nav_set_yaw_speed replaced with mode_guided.set_desired_heading_and_speed
set_guided_velocity replaced with mode_guided.set_desired_turn_rate_and_speed
guided_control structure replaced with mode_guided members
use_pivot_steering accepts yaw-error argument instead of calculating it itself internally
2017-08-05 11:20:58 +09:00
Randy Mackay
783f8243df Rover: use mode class's get_distance_to_destination and speed_error
used for reporting to GCS and logging
2017-08-05 11:20:58 +09:00
Peter Barker
dbac7447d6 Rover: move try_send_message send_hwstatus up 2017-08-03 14:34:33 +01:00
Peter Barker
4da89a948a Rover: move try_send_message mission handling up 2017-08-03 14:33:37 +01:00
khancyr
23532bf45c Rover: add reason to set_mode 2017-07-31 18:01:17 +09:00
Peter Barker
81d52c282c Rover: camera is responsible for taking distance-based-images and logging 2017-07-28 14:27:53 +01:00
Randy Mackay
ddc70058d5 Rover: reporting wheel encoder rpm 2017-07-27 16:52:29 +09:00
Randy Mackay
72d35593d8 Rover: send wheel encoder data to EKF 2017-07-27 16:52:28 +09:00
Randy Mackay
f17f56dea4 Rover: move throttle nudge to Mode class 2017-07-21 10:13:20 +09:00
Peter Barker
07f4603533 Rover: integrate mode class 2017-07-21 10:13:20 +09:00
Peter Barker
9173c7caaf Rover: move starting of new logs into DataFlash 2017-07-19 16:37:28 +01:00
khancyr
918992eb10 Rover: remove unimplemented functions 2017-07-19 11:00:34 +09:00