Julian Oes
027d7e632e
sitl_multiple_run.sh: fix port description
...
This has changed as we changed to TCP with the lockstep implementation.
2019-01-30 09:51:30 +01:00
Julian Oes
e1472818dc
mavlink_mission: round lat/lon
...
This avoids casting errors. An alternative to `std::round` would be to
add 0.5 before casting for positive values and subtract 0.5 before
casting for negative values.
2019-01-22 09:49:24 -05:00
Julian Oes
2e3fa30c83
sitl_gazebo: update to revision that doesn't abort on timeout ( #11196 )
...
* this should fix the CI failures where we intermittently saw SIGABRT. (fixes #11144 )
2019-01-11 10:23:16 -05:00
Julian Oes
b0dd55e80b
jMAVSim: update submodule
...
This should fix:
- HITL regression (Init MAVLink forever).
- Starting using default arguments.
2019-01-08 09:49:47 -05:00
Julian Oes
032e64aaf2
px4_sem: set errno, return -1 on any error
...
- Don't duplicate the ret variable to err.
- Return -1 on any error, 0 otherwise.
- Set errno to return value of pthread_cond_timedwait.
2019-01-01 20:35:42 +01:00
Julian Oes
23653f9f39
lockstep_scheduler: fix return value, remove errno
...
The API of cond_timedwait was wrong. It used return -1 and set errno
instead of returning the error as specified for pthread_cond_timedwait
which it tries to mock.
2019-01-01 20:35:42 +01:00
Julian Oes
29bfdb0c88
platforms: fix linking for qurt ( #11115 )
2018-12-29 16:21:52 -05:00
Julian
3e87013936
simulator: fix TCP on Cygwin-Windows
...
It turns out that `sendto` does not work for TCP on Cygwin-Windows,
instead we need to use `send`. This required some refactoring since we
need to have the internet protocol and the port stored as a member
variable.
This should fix that lockstep SITL simulation was not working on
Windows.
2018-12-27 07:49:12 +01:00
Julian Oes
73ed9deac5
mixer: add missing include
2018-12-22 10:32:18 +01:00
Julian Oes
ea87bcb5a2
DriverFramework: update submodule
...
Now that the lockstep changes are merged to master.
2018-12-22 10:32:18 +01:00
Julian Oes
dd54b3a511
jMAVSim: update submodule
...
Now that this is merged to master in jMAVSim.
2018-12-22 10:32:18 +01:00
Julian Oes
8486b2b917
tests: properly disable shutdown test for Cygwin
2018-12-22 10:32:18 +01:00
Julian Oes
736599f362
sitl_gazebo: updated submodule
...
This is just because the branch got merged.
2018-12-22 10:32:18 +01:00
Julian
0601214806
tests: disable shutdown and hysteresis for Cygwin
...
It seems that the hysteresis test fails every now and then, presumably
due to timing issues. The tests needs some improvements, e.g. isolating
it from the system time.
2018-12-22 10:32:18 +01:00
Julian Oes
a1fc44d1f0
simulator: fix noise in airspeed
...
It turns out the noise of the airspeed depends on the least significant
bit of time which is now always 0 because time is quite regular with
lockstep. Therefore, we need a better source for the randomness. I chose
to use the sign of the y-gyro and it seems to work.
2018-12-22 10:32:18 +01:00
Julian Oes
2d7299043d
sitl_gazebo: update submodule
...
This should fix a race because the use of future/promise wasn't done in
a thread-safe way.
2018-12-22 10:32:18 +01:00
Julian Oes
6435db37c6
sitl_gazebo: update submodule
...
An include was missing.
2018-12-22 10:32:18 +01:00
Julian Oes
9916fb9b07
Jenkins: fix path to test results
2018-12-22 10:32:18 +01:00
Julian Oes
73c22bd60e
sitl_gazebo: updated submodule
...
This fixes a HITL bug and uses promise/future instead of sleeping.
2018-12-22 10:32:18 +01:00
Julian Oes
2e78b6f2d4
Jenkins: use test board for unit test only
2018-12-22 10:32:18 +01:00
Julian Oes
3e452e2e72
boards: tone_alarm_sim was missing for test board
2018-12-22 10:32:18 +01:00
Julian Oes
6b37102b8e
Jenkins: use test board for unit and coverage test
2018-12-22 10:32:18 +01:00
Julian Oes
8faf28918c
sitl_gazebo: update submodule
...
This brings build fixes for Gazebo 7.
2018-12-22 10:32:18 +01:00
Julian Oes
ffb73f6496
platforms: fix redefinition for QURT
2018-12-22 10:32:18 +01:00
Julian Oes
aac7b8d7eb
platforms: fix NuttX build
2018-12-22 10:32:18 +01:00
Julian Oes
14e5ebbbbc
platforms: fix clock build for macOS (yet again)
2018-12-22 10:32:18 +01:00
Julian Oes
06c5037025
platforms: use CLOCK_MONOTONIC
...
For the non-lockstep case we want to use CLOCK_MONOTONIC if possible.
2018-12-22 10:32:18 +01:00
Julian Oes
d94748c831
Makefile: use px4_sitl_test board for make tests
...
This means that we can use the normal host scheduling (not lockstep) for
the unit tests.
In the future we might add unit tests using lockstep as well.
2018-12-22 10:32:18 +01:00
Julian Oes
547dd8511b
platforms: use define for lockstep scheduler
...
Instead of using the define __PX4_POSIX_SITL it makes more sense to have
a define just to determine if the lockstep scheduler should be used.
2018-12-22 10:32:18 +01:00
Julian Oes
73578a593f
simulator: bring -t argument back
...
The -t argument had been deleted because I didn't realize that it was
actually being used. Therefore, this brings it back and we now use -c
for TCP.
2018-12-22 10:32:18 +01:00
Julian Oes
f03e938953
sitl_gazebo: updated submodule
...
This fixes all world files at 250 Hz simulation rate.
2018-12-22 10:32:18 +01:00
Julian Oes
d0251581d3
samv7: fix include
2018-12-22 10:32:18 +01:00
Julian Oes
a7c2adc877
sitl_gazebo: update submodule
...
This brings support for TCP and lockstep.
2018-12-22 10:32:18 +01:00
Julian Oes
1b685de70d
simulator: raise timeout
...
This is not suposed to ever trigger anyway.
2018-12-22 10:32:18 +01:00
Julian Oes
8b2c47523f
simulator: set socket options after opening socket
2018-12-22 10:32:18 +01:00
Julian Oes
e4af97b11b
simulator: fix printf format
2018-12-22 10:32:18 +01:00
Julian Oes
564cae86b5
simulator: remove doubled tcgetattr call
2018-12-22 10:32:18 +01:00
Julian Oes
8a5e0558e4
simulator: improve a couple of error messages
2018-12-22 10:32:18 +01:00
Julian Oes
1165739a56
sensors: check other gyros on timeout
...
@bkueng reviewed this and found that it is dangerous to continue on
timeout because we don't update other gyro sensors in the timeout case.
2018-12-22 10:32:18 +01:00
Julian Oes
8e4296d000
parameters: remove unneeded usleep
...
According to @bkueng this was to schedule other processes but can now be
removed.
2018-12-22 10:32:18 +01:00
Julian Oes
5280a4aba1
platforms: prevent wrap-arounds in px4_sleep
...
@bkueng found that the old implementation was likely to wrap-around
given seconds is only a uint32_t. We now cast it directly to uint64_t
and therefore should fix this problem.
2018-12-22 10:32:18 +01:00
Julian Oes
4efe4b0d15
platforms: reorg after rebase on new board config
...
The new board config changed everything, so I needed to move the
lockstep_scheduler repo.
2018-12-22 10:32:18 +01:00
Julian Oes
b4382d4a71
DriverFramework: updated submodule
2018-12-22 10:32:18 +01:00
Julian Oes
185ddb2ab6
lockstep_scheduler: format to PX4 style
...
Consistency over taste :(.
2018-12-22 10:32:18 +01:00
Julian Oes
fb9f72d029
lockstep_scheduler: modernize warnings
2018-12-22 10:32:18 +01:00
Julian Oes
6d273f3bd8
px4_layer: modernize warnings
2018-12-22 10:32:18 +01:00
Julian Oes
85486e0469
platforms: let's try clockid_t as int
...
Who knows what this really is.
2018-12-22 10:32:18 +01:00
Julian Oes
f3aad419ac
DriverFramework: update submodule
...
Hopefully, we can fix the defines for macOS.
2018-12-22 10:32:18 +01:00
Julian Oes
c24f6ef943
platforms: lockstep_scheduler ain't no submodule
2018-12-22 10:32:18 +01:00
Julian Oes
7b43e96896
platforms: copied files from lockstep-scheduler
...
The files are copied from:
https://github.com/julianoes/lockstep-scheduler/
2018-12-22 10:32:18 +01:00
Julian Oes
3cbb2d8661
platforms: removed lockstep_scheduler submodule
2018-12-22 10:32:18 +01:00
Julian Oes
357870377a
platforms: try to get submodule checked out
2018-12-22 10:32:18 +01:00
Julian Oes
f36f85010c
simulator: fix casting warning on Windows
2018-12-22 10:32:18 +01:00
Julian Oes
393a665424
DriverFramework: update submodule
...
Fixes the unit test on macOS.
2018-12-22 10:32:18 +01:00
Julian Oes
e046a6255f
DriverFramework: update submodule
...
This brings a couple more build fixes.
2018-12-22 10:32:18 +01:00
Julian Oes
e41518a08b
platforms: clean up various build/linking issues
...
This makes sure lockstep is only built for SITL builds and fixes the
existing builds.
2018-12-22 10:32:18 +01:00
Julian Oes
23264fe579
kinetis: add missing include
2018-12-22 10:32:18 +01:00
Julian Oes
9724a84801
gitmodules: use https link for lockstep-scheduler
2018-12-22 10:32:18 +01:00
Julian Oes
8cbe26c6f6
platforms: fix linking issues for NuttX build
2018-12-22 10:32:18 +01:00
Julian Oes
a193e4117c
drv_hrt: update signature of ts_to_abstime
2018-12-22 10:32:18 +01:00
Julian Oes
d75389b2e4
platforms: consolidate latency_buckets
...
These symbols were duplicated all over the place.
2018-12-22 10:32:18 +01:00
Julian Oes
b13600ed1a
platforms: remove TODO
...
It turns out Mac OS X v10.11.6 (El Capitan) is still covered by security
updates at this time, so not end-of-lifed, so we might as well keep
these legacy things.
2018-12-22 10:32:18 +01:00
Julian Oes
22b584b3b4
simulator: fix TCP connection init on macOS
...
When `connect()` fails, the state of the socket is unspecified and we
need to close the it and create it again.
It turns out retrying connect worked on Linux but it didn't on macOS.
2018-12-22 10:32:18 +01:00
Julian Oes
b2f1a59164
DriverFramework: update submodule
...
This fixes the build on macOS.
2018-12-22 10:32:18 +01:00
Julian Oes
6ed6941aba
DriverFramework: update submodule
...
This fixes the SITL speedup for macOS.
2018-12-22 10:32:18 +01:00
Julian Oes
546f89aee7
lockstep_scheduler: update submodule
2018-12-22 10:32:18 +01:00
Julian Oes
876d4ebd76
posix: remove appalling errno hack
2018-12-22 10:32:18 +01:00
Julian Oes
66e7b4d578
posix: remove random lies
2018-12-22 10:32:18 +01:00
Julian Oes
11b7411bf8
platforms: cleaned up defines
2018-12-22 10:32:18 +01:00
Julian Oes
23acb77e2d
Tools: add PX4_SIM_SPEED_FACTOR as env variable
...
This adds the env variable PX4_SIM_SPEED_FACTOR to set the speed factor
to run SITL at.
2018-12-22 10:32:18 +01:00
Julian Oes
107606e757
simulator: set device_ids when publishing directly
...
Without setting the device_id, the preflight checks fail because the
calibration is not found.
2018-12-22 10:32:18 +01:00
Julian Oes
843033d530
platforms: remove unused function
2018-12-22 10:32:18 +01:00
Julian Oes
b436f3dd56
ROMFS/Tools: switch to TCP connection for SITL
...
This switches from UDP to TCP to connect to jMAVSim.
2018-12-22 10:32:18 +01:00
Julian Oes
6d7fb232dd
simulator: added TCP, general cleanup, lockstep
...
This adds the option to connect over UDP or TCP for mavlink to the
SITL simulator.
Also, this includes a bunch of general cleanup and refactoring of the
simulator interface code. For instance sending of mavlink messages was
put into separate functions and unneccessary comments were removed.
Also, this now sets the timestamp sent by the SITL simulator in the
HIL_SENSOR message in order to enable lockstep.
2018-12-22 10:32:18 +01:00
Julian Oes
cf39fdd37b
simulator: use usual type of timestamp
2018-12-22 10:32:18 +01:00
Julian Oes
9b7857315c
sensors: handle timeout
2018-12-22 10:32:18 +01:00
Julian Oes
22bd06e5d5
mc_pos_control: don't do orb_check on polled topic
...
When we poll on vehicle_local_position we shouldn't do yet another
orb_check but copy it first up.
2018-12-22 10:32:18 +01:00
Julian Oes
0e04d3e9a9
commander: remove lying comment
2018-12-22 10:32:18 +01:00
Julian Oes
e36e0b6ad0
posix: print warning before backtrace
2018-12-22 10:32:18 +01:00
Julian Oes
4ef0d74ea3
platforms: remove old lockstep functionality
...
These functions won't be used any longer with the new implementation.
2018-12-22 10:32:18 +01:00
Julian Oes
14642edfda
gps/devices: updated submodule
2018-12-22 10:32:18 +01:00
Julian Oes
cc7cae4e7f
DriverFramework: updated submodule
...
This fixes a race/lockup happening in the DriverFramework scheduler.
2018-12-22 10:32:18 +01:00
Julian Oes
7c93578b8b
jMAVSim: updated submodule
2018-12-22 10:32:18 +01:00
Julian Oes
a7e93bc2da
simulator: removed leftover (wrong) comment
2018-12-22 10:32:18 +01:00
Julian Oes
09595a1de9
dataman: left FIXME comment
...
We shouldn't be using module here.
2018-12-22 10:32:18 +01:00
Julian Oes
3f508c99fd
parameters: commented out strange usleep
2018-12-22 10:32:18 +01:00
Julian Oes
da9029274c
pwm_out_sim: always publish actuators
...
This is required so that the SITL simulator receives a feedback from
PX4.
2018-12-22 10:32:18 +01:00
Julian Oes
d1514cd667
POSIX: add defines system clock calls
2018-12-22 10:32:18 +01:00
Julian Oes
98ae0186e9
px4_sem: use px4_sem on all POSIX system
...
This uses the "fake" px4_sem based on mutex and condition_variable on
all POSIX system, not just macOS and Cygwin. This means that we can
change px4_sem_timedwait under the hood and inject the simulated time.
2018-12-22 10:32:18 +01:00
Julian Oes
3e6e1f5c2b
POSIX: use lockstep_scheduler to fake time
...
This integrates the lockstep_scheduler, so that the system time is set
by the mavlink HIL_SENSOR message.
This means that the speed factor is removed and the speed is entirely
given by the simulator.
2018-12-22 10:32:18 +01:00
Julian Oes
f0ce300744
platforms: move latency_buckets to perf.c
2018-12-22 10:32:18 +01:00
Julian Oes
6466e690fe
DriverFramework: update submodule
2018-12-22 10:32:18 +01:00
Julian Oes
4af0c939ec
lockstep_scheduler: update submodule
2018-12-22 10:32:18 +01:00
Julian Oes
fa8ac612ab
POSIX: use C++ for drv_hrt (file was renamed)
2018-12-22 10:32:18 +01:00
Julian Oes
5df333fa96
POSIX: include lockstep_scheduler in build
2018-12-22 10:32:18 +01:00
Julian Oes
6a78212a6b
jMAVSim: update submodule
2018-12-22 10:32:18 +01:00
Julian Oes
d295320e82
sitl_run.sh: lower rate for jMAVSim to 250 Hz
...
This should be enough for now, especially when we want to raise the
speed of the simulation.
2018-12-22 10:32:18 +01:00
Julian Oes
5ff3c40179
Added lockstep_scheduler as submodule
...
This is just an intermediate step until we can copy the sources over.
2018-12-22 10:32:18 +01:00
Julian Oes
fa31d95fd8
Renamed drv_hrt.c to drv_hrt.cpp
2018-12-22 10:32:18 +01:00
Julian Oes
db6de38b19
Work in progress to support a speed factor in SITL
...
These contains some rough changes trying to get SITL to speed up by a
SPEED_FACTOR.
This platform time code probably requires some more thought and refactor
but this gets a demo at 4x working.
2018-12-22 10:32:18 +01:00