423 Commits

Author SHA1 Message Date
Matthias Grob
10ceea2fe6 geo: refactoring on comments and usage 2021-12-06 14:30:14 +01:00
Thomas Debrunner
8db7a6225b geo: Moved the map_projection_* functions and state into a self-contained C++ class 2021-12-06 14:30:14 +01:00
wangwwno1
7a1a4ea7a6 Format fix & Remove redundant lines 2021-11-20 16:13:46 +01:00
wangwwno1
51ce8306ee Remove redundant code out of hil_lpos 2021-11-20 16:13:46 +01:00
wangwwno1
b2c5919d29 Update src/modules/simulator/simulator_mavlink.cpp
Co-authored-by: JaeyoungLim <jalim@ethz.ch>
2021-11-20 16:13:46 +01:00
wangwwno1
160fec5f25 Update simulator_mavlink.cpp 2021-11-20 16:13:46 +01:00
wangwwno1
6e2060ddb6 Add accel to vehicle_local_position_groundtruth
Related Issue: #18527 
According to [this doc](92b1a43468/common/mavlink_msg_hil_state_quaternion.h (L102)), the *acc value are mili-Gee, so multiply the value with `CONSTANT_ONE_G/1000.0f` would get the acceleration in `m/s`.
2021-11-20 16:13:46 +01:00
Jacob Crabill
5969508fa7
mavlink: cmake generate mavlink headers at build time
- mavlink/mavlink is now directly included as a submodule instead of the generated mavlink/c_library_v2
 - this also switches to mavlink development.xml by default
2021-11-05 23:01:38 -04:00
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
Daniel Agar
089c962d92 px4io: moving mixing to FMU side
Using mixers on the IO side had a remote benefit of being able to
override all control surfaces with a radio remote on a fixed wing.
This ended up not being used that much and since the original design
10 years ago (2011) we have been able to convince ourselves that the
overall system stability is at a level where this marginal benefit,
which is not present on multicopters, is not worth the hazzle.

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-09-25 19:15:05 -04:00
Daniel Agar
65745a3676 purge broken qurt support and atlflight boards 2021-07-16 08:53:36 -04:00
Daniel Agar
883624d915 lib/geo: move from ecl 2021-07-15 10:38:24 -04:00
Daniel Agar
dbaed99626
cmake remove git_ecl target 2021-07-13 10:03:06 -04:00
Matthias Grob
f41c294028 BatterySimulator: No need to explicitly mention throttle being set to zero 2021-07-01 14:24:38 +02:00
Daniel Agar
39c96a8884 gps add device_id 2021-04-08 08:27:07 +02:00
obicons
a7e920d276 Updated MavlinkReceiver::handle_message_landing_target to warn users when they provide a landing target with an unsupported coordinate frame.
Updated Simulator::handle_message_landing_target to warn users when they provide a landing target that is not relative to a captured image.
2021-04-06 16:02:54 -04:00
Daniel Agar
4189eb11f5 simulator: GPS populate all sensor_gps fields (alt_ellipsoid, etc) 2021-04-06 09:44:18 -04:00
Chris Lovett
292a66ce41
Add support for simulators running on a different host than the PX4 instance 2021-03-31 20:56:38 -04:00
Beat Küng
629f7ba15b params: ensure short description is only a single line
So a UI can display it properly
2021-03-23 12:55:11 -04:00
David Jablonski
063bb75891 simulator: fix lidar sensors 2021-03-08 21:27:39 -05:00
Daniel Agar
263b00b65f
ekf2 support SET_GPS_GLOBAL_ORIGIN and remove globallocalconverter usage
- vehicle_command cmd extended from uint16 to support PX4 internal commands that don't map to mavlink
2021-03-05 18:25:14 -05:00
Daniel Agar
9d47f7ecda simulator: make first accel/gyro simulated FIFO 2021-02-26 18:40:37 -05:00
Peter Blom
a4745c6825 Simulator: Fix for arg count increase breaking remote host option.
The number of arguments was increased by one, see: 1719ff9892

Because the above commit was merged before https://github.com/PX4/PX4-Autopilot/pull/15443 . It broke support for the remote host option.

This has been fixed in this commit by increasing all argv's by one.

Signed-off-by: Peter Blom <peterblom.mail@gmail.com>
2021-01-28 08:32:14 +01:00
JacobCrabill
e49717513c simulator: Fix distance sensor device_id
Also add DRV_DIST_DEVTYPE_SIM
2021-01-27 17:02:20 -05:00
Daniel Duecker
f9e07337f8
fix submarine sitl: indicate motor channel range 0..1 or -1..1 in simulation_mavlink.cpp (#16637)
change motor_count variable to 'pos_thrust_motor_count'
This is more specific to what is actually happening in the code.
'pos_thrust_motors_count' indicates number of motor channels which are configured with 0..1 range (positive thrust) all other motors are configured for -1..1 range

submarine only have motors with -1..1 range.
Thus, pos_thrust_motor_count = 0

Co-authored-by: Thies Lennart Alff <33184858+lennartalff@users.noreply.github.com>
2021-01-25 14:17:24 +01:00
Daniel Agar
a57b9f9381 delete drv_baro.h, drv_mag.h, drv_range_finder.h, drv_device.h and purge UAVCAN CDev usage 2021-01-12 22:04:52 -05:00
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
TSC21
cef3d36af2 simulator: delete PublicationMulti ptrs for sensor_gps 2021-01-10 19:58:54 +01:00
Muesli_Reep
fe7908feb0
Simulator: Added remote host option (#15443)
* Added an option to the Simulator module to connect to remote Gazebo servers.

This is usefull when the Gazebo simulation is running on a different host than the PX4 instance.
For example, we are running instances of PX4 with a companion application in multiple Dockers, for swarming simulations, which then connect to a remote Gazebo server.

A "-t" input argument has been added and can be called from the rcS startup script as: simulator start -t "192.168.178.122" $simulator_tcp_port

* _tcp_remote_ipaddr defaults to nullptr. This way testing against nullptr it can be determined if localhost or remote host is desired by the user.
* Documented the option in usage().

Signed-off-by: Peter Blom <peterblom.mail@gmail.com>
2021-01-10 18:37:37 +01:00
Lorenz Meier
a34e57a4cc Simulator: Increase stack, publication affinity
This commit increases the send thread stack size and changes the thread affinity of the lockstep clocking topic. It also improves verbosity in case error states occur.
2020-12-31 01:05:30 +01:00
Julian Oes
1719ff9892 simulator: fix after px4_task_spawn_cmd change
argv[0] now contains the task name, so everything moves by one.
2020-12-14 09:26:18 +01:00
BazookaJoe1900
bd09be43c0
simulator mavlink actuator limits (#15861)
using unified way to decide which output should be scale as rotor
fixed case that actuator that wasn't set (value 0 "PWM") results output of -3
make default actuator mode to set all actuator to range of -1 to +1
cleanups
2020-11-26 14:42:31 +01:00
Thies Lennart Alff
82988b1912
airframes: added BlueROV2 (heavy configuration) airframe (#16004) 2020-10-28 11:07:31 +01:00
Daniel Agar
0f411d6820
Multi-EKF support (ekf2)
- ekf2 can now run in multi-instance mode (currently up to 9 instances)
    - in multi mode all estimates are published to alternate topics (eg estimator_attitude instead of vehicle_attitude)
 - new ekf2 selector runs in multi-instance mode to monitor and compare all instances, selecting a primary (eg N x estimator_attitude => vehicle_attitude)
 - sensors module accel & gyro inconsistency checks are now relative to the mean of all instances, rather than the current primary (when active ekf2 selector is responsible for choosing primary accel & gyro)
 - existing consumers of estimator_status must check estimator_selector_status to select current primary instance status
 - ekf2 single instance mode is still fully supported and the default

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2020-10-27 10:56:11 -04:00
FengShun
eac9a6b68b Replace PublicationQueued with Publication to automatically configure ORB_QUEUE_LENGTH 2020-10-26 13:01:13 +01:00
JaeyoungLim
46d79d3050
Remove exception of actuator scaling for airships (#16011)
This removes the exception handling of airship type vehicles when scaling actuators for the simulator
2020-10-22 10:37:03 +02:00
Daniel Agar
0a985638e3 simulator: add inject failure messages for logging 2020-10-10 20:03:50 -04:00
Daniel Agar
378cb155d6
simulator: support accel/gyro instances and stuck failure
- expand simulator to 3 accels and gyros
 - PX4Accelerometer/PX4Gyroscope switch to old param usage due to copy constructor issues with ModuleParams
2020-10-07 13:20:13 -04:00
Daniel Agar
fe6a1ce882
simulator: fix airspeed temperature
- HIL_SENSOR temperature is only being sent with barometer data
2020-09-28 12:56:56 -04:00
Jacob Dahl
a24488328f
Move GPS blending from ekf2 to sensors module
- new sensors work item that subscribes to N x sensor_gps and publishes vehicle_gps_position
 - blending is now configurable with SENS_GPS_MASK and SENS_GPS_TAU

Co-authored-by: Jacob Crabill <jacob@volans-i.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2020-09-25 23:28:31 -04:00
Julian Oes
9ed07a7873 simulator: fix temperature setting after rebase 2020-09-16 12:51:56 -04:00
Julian Oes
a37b839e27 simulator: add missing timestamp 2020-09-16 12:51:56 -04:00
Julian Oes
4d76ed34f3 simulator: update temperature in sync with baro
This fixes the case where the baro was not rejected if stuck because the
temperature still varied.
2020-09-16 12:51:56 -04:00
Julian Oes
c31246e13a mavsdk_tests: add test for stuck mag 2020-09-16 12:51:56 -04:00
Julian Oes
afcfa2fbe0 mavsdk_tests: check for stuck baro 2020-09-16 12:51:56 -04:00
Julian Oes
a9c4f269bd simulator: use failure injection to block GPS
This uses the new failure injection system using vehicle_commands
instead of specific parameters. For now it implements GPS only.
2020-09-16 12:51:56 -04:00
Daniel Agar
6ff361479c
uORB: introduce SubscriptionMultiArray for working with multi-instances 2020-09-02 12:46:47 -04:00
Daniel Agar
5017a7e33a
simulator: publish 2 instances of accel/baro/gyro/mag 2020-09-02 10:42:02 -04:00
Matthias Grob
0db4881413 BatterySimulator: remove SimulatorBattery
It loads the battery parameters but then overwrites them
with hardcoded values and it breaks the ModuleParams
parent/child hierarchy. Both is undesired.
2020-09-01 10:25:03 +02:00
Daniel Agar
27f23ac290 move initial sensor priority to parameters and purge ORB_PRIORITY
- CAL_ACCx_EN -> CAL_ACCx_PRIO
 - CAL_GYROx_EN -> CAL_GYROx_PRIO
 - CAL_MAGx_EN -> CAL_MAGx_PRIO
2020-08-21 10:12:13 -04:00