AP_UAVCAN: fixed build of example on px4
This commit is contained in:
parent
92cda24659
commit
49dfccbcee
@ -4,12 +4,15 @@ be received by another node.
|
||||
|
||||
To build and upload for a Pixhawk style board run this:
|
||||
|
||||
./waf configure --board fmuv3
|
||||
```
|
||||
./waf configure --board fmuv3
|
||||
./waf --target examples/UAVCAN_sniffer --upload
|
||||
```
|
||||
|
||||
then connect on the USB console. You will see 1Hz packet stats like
|
||||
this:
|
||||
|
||||
```
|
||||
uavcan.equipment.air_data.StaticPressure: 29
|
||||
uavcan.equipment.air_data.StaticTemperature: 29
|
||||
uavcan.equipment.ahrs.MagneticFieldStrength: 20
|
||||
@ -18,6 +21,7 @@ uavcan.equipment.gnss.Fix: 10
|
||||
uavcan.equipment.gnss.Auxiliary: 1
|
||||
uavcan.equipment.actuator.ArrayCommand: 45
|
||||
uavcan.equipment.esc.RawCommand: 368
|
||||
```
|
||||
|
||||
note that the code requires you to add new msg types you want to
|
||||
see. Look for the MSG_CB() and START_CB() macros in the code
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <AP_Common/AP_Common.h>
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
||||
|
||||
#include <uavcan/uavcan.hpp>
|
||||
|
||||
@ -301,4 +301,17 @@ void loop(void)
|
||||
|
||||
AP_HAL_MAIN();
|
||||
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
|
||||
|
||||
static void loop() { }
|
||||
static void setup()
|
||||
{
|
||||
printf("Board not currently supported\n");
|
||||
}
|
||||
|
||||
AP_HAL_MAIN();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user