61 Commits

Author SHA1 Message Date
Lorenz Meier
9eb748ed5b Always publish RC data from Pixhawk 2015-09-20 17:48:35 +02:00
Lorenz Meier
6a2e50d2a8 Simulator: Cleaner data structure init 2015-09-20 16:42:48 +02:00
Lorenz Meier
985243c932 Merged 2015-09-20 15:06:27 +02:00
Lorenz Meier
fe644fb3e0 Merge branch 'cmake-2' into cmake-2-pthread 2015-09-20 12:56:14 +02:00
Lorenz Meier
324c786e0a Simulator: Init sensor data diligently 2015-09-20 12:55:32 +02:00
Lorenz Meier
08c56085b3 Merged cmake-2 2015-09-20 11:37:28 +02:00
Lorenz Meier
30d0dab8e6 Simulator: Fix code style 2015-09-20 11:35:52 +02:00
Lorenz Meier
bbccb8ed5f Simulator: Add required POSIX header 2015-09-20 10:58:29 +02:00
Lorenz Meier
a2ea70c7a0 Simulator: Move to semaphore abstraction 2015-09-20 00:29:03 +02:00
Lorenz Meier
0597c57c32 Simulator: Provide better and more user-facing feedback 2015-09-12 15:44:40 +02:00
Lorenz Meier
458b72352a Simulator: POSIX adjustments 2015-09-11 21:49:29 +02:00
Mark Charlebois
91cf77c68b Added more missing modules for posix
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-08 16:12:45 -07:00
James Goppert
1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Lorenz Meier
a1f93f52b0 Merge pull request #2811 from mcharleb/qurt_rebase_updates-3
Qurt rebase updates 3
2015-09-05 11:55:03 +02:00
tumbili
0fe272c9b3 support simulated airspeed 2015-09-04 22:34:28 +02:00
Mark Charlebois
54bae34a2c Build fixes for qurt after rebase on PX4 master
Removed the re-definitions of the usage method in the posix/main.cpp file.
Added qurt_external_hook interface to call externally linked module.
Fixed code format to comply with PX4 style.
Added usage information to main app and handled cases for unknown arguments.
Fixed the orb_priority interface to use int32_t instead of int.
Fixes to get hil working with led changes.
Added the config_eagle_adsp.mk file and update the make files to to use new
include/lib paths

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-04 11:09:29 -07:00
tumbili
980217468f set actuator commands to zero if vehicle status is still unknown 2015-09-02 21:58:29 +02:00
tumbili
b1850a316b support sitl for planes 2015-09-01 09:40:20 +02:00
Mark Charlebois
009f528266 Fixes for posix-arm and qurt builds
Ifdefed out deadcode in position_estimator_inav_main.c as the
deadcode does not compile for qurt.

Added fixes to get a successful build for posix-arm and qurt targets.
Removed CLOCK_REALTIME def from px4_time.h for qurt and removed unused
variables in att_est_q and mc_att_control.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-05 18:34:46 -07:00
Lorenz Meier
f0f28d5420 POSIX SIM: Reset the HRT on system boot 2015-07-04 08:35:11 -07:00
Lorenz Meier
5a1af860ab Sim: Enforce boot order is correct, sim starts first 2015-07-04 08:09:12 -07:00
Lorenz Meier
32bf4dc773 simulator: Add output so user knows that the simulator / system is waiting for data 2015-07-04 07:25:08 -07:00
Mark Charlebois
c611749b4f Simulator: modified -p to publish individual sensor data
The simulator was changed to publish the sensor data that is read
by the sensors module when the -p flag is passed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-07-01 18:20:14 -07:00
Lorenz Meier
878284701d POSIX: Simulator: Use port 14560, since 14550 is QGroundControls default port 2015-06-19 10:45:26 -07:00
Mark Charlebois
d66b6ea701 POSIX: px4_getpid() fix
Since the PX4 code uses both px4_task and pthread APIs,
px4_getpid() must be save to call from either context.

On posix, this means we have to always return the pthread ID.

Reverted simulator change of pthread to px4_task

There may have been side effects if this was build for a target that
has process/task scoped file descriptors. It is now safe to call
px4_getpid() from this pthread context with this change for the
posix build for px4_getpid().

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-15 08:25:57 -07:00
Mark Charlebois
7e7513bc15 POSIX: change pthreads to px4_tasks in simulator
The simulator was using pthread APIs directly so calls to px4_getpid()
would fail since the task ID was not known. Changed simulator to use
px4_task_spawn_cmd.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-13 16:44:29 -07:00
tumbili
a5c214a7bb use orb_advertise_multi:
- subscribe to actuator controls after topic has been advertised
2015-06-08 22:21:59 -07:00
tumbili
065ec5b2dc no need to send non-controls mavlink messages to jMAVSim because we can use mavlink app with udp 2015-06-08 22:21:59 -07:00
tumbili
8eee7ba321 compute atmospheric pressure from altitude 2015-06-08 22:21:59 -07:00
Mark Charlebois
fd1effa4fe Simulator: UART changes
Some changes were needed to use the simulator and the UART for rc control.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-08 22:21:59 -07:00
tumbili
5c013af574 save gps data so driver can read 2015-06-08 22:21:59 -07:00
tumbili
45ee36234d activate sending thread only once got message from simulator 2015-06-08 22:21:58 -07:00
tumbili
f0a3210e94 major simulator rework:
- wait for first message from jMAVSim
  before sending data
- publish raw rc data coming from PIXHAWK (temporary)
- send some interesting messages to jMAVSim
- prepare sensor data for sim drivers to read
2015-06-08 22:21:58 -07:00
Lorenz Meier
9882b78383 Merge pull request #2248 from mcharleb/gyrosim-fix
Gyrosim: Fixed constant looping
2015-06-02 01:40:49 -07:00
Mark Charlebois
ca88251124 Fixes for gcc 4.8
The use of a non-static function without a declaration generates a
warning for gcc 4.8.

Clang-3.4 does not work when compiling for gprof. The executable always
generates a segv.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-29 12:38:51 -07:00
Mark Charlebois
2d85578599 Gyrosim: Fixed constant looping
Gyrosim would call measure continuously because the write_checked_reg
was failing. There is no need to check faked reg writes in the
simulator so that code was removed.

The delay that was added to the simulator to pace the gyrosim reads
was also removed now that the source of the problem was determined.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-28 11:20:30 -07:00
Mark Charlebois
1ca05aaa64 orb_advert_t changed to void * and checks changed to nullptr
The existing orb_advert_t use thoughout the code sometimes tries
to treat it as a file descriptor and there are checks for < 0
and ::close calls on orb_advert_t types which is an invalid use
of an object pointer, which is what orb_advert_t really is.

Initially I had changed the -1 initializations to 0 but it was
suggested that this should be nullptr. That was a good recommendation
but the definition of orb_advert_t had to change to void * because
you cannot initialize a uintptr_t as nullptr.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:42:49 -07:00
Mark Charlebois
a734fc96d1 extensive orb_advert_t fixes
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.

The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.

Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:41:33 -07:00
Mark Charlebois
f1f562a94d POSIX: Fixed orb_advertise failure
There were an insufficient number of devmap entries allocated and
when they ran out, new orb_advertise requests would fail.

Also added a new logging macro for the Linux build to show the
calling pthread if enabled.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-21 15:35:11 -07:00
Mark Charlebois
ffdc9d629c POSIX: Improved logging
The warnx and warn calls map to PX4_WARN.
Calls to errx or err genrtate a compile error.

The px4_log.h file implements a new log format:

For DEBUG and INFO:
<level> <msg>

For ERROR and WARN:
<level> <msg> (file filepath line linenum)

The verbosity can be changed by setting the macro to use
either linux_log or linux_log_verbose in px4_log.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 09:19:24 -07:00
Roman Bapst
4a84215a8f fix mavlink message sending, make thread priority default 2015-05-15 17:49:20 +02:00
Roman Bapst
cf27fc59c7 read hil sensor message instead of highres imu message 2015-05-13 10:31:52 +02:00
tumbili
9686f8004e send pwm outputs to simulator 2015-05-12 23:55:32 +02:00
tumbili
3a79679e2d get manual control setpoint from PIXHAWK 2015-05-12 23:15:58 +02:00
Mark Charlebois
d0bf4ab449 Simulator: refactored mavlink additions
QuRT does not support UDP so moved the mavlink specific code
to a new file that is not built for the qurt target

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-11 19:25:11 -07:00
Mark Charlebois
2d32395bc0 Merge branch 'qurt' into linux 2015-05-11 16:07:53 -07:00
Mark Charlebois
a99f916bdf POSIX: Changed px4_debug.h to px4_log.h
Also changed use of printf to PX4_WARN or PX4_INFO in posix and
qurt tests.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-11 16:04:39 -07:00
tumbili
c074d6e913 implemented polling of socket file descriptor and uorb topic file descriptor 2015-05-11 23:55:11 +02:00
tumbili
9119687177 make socket non-blocking, moved socket includes to header file to avoid forward declarations 2015-05-09 10:35:25 +02:00
tumbili
39711ca908 implemented bidirectional udp communication with simulator 2015-05-08 21:51:21 +02:00