AP_UAVCAN: fixed build of example on px4

This commit is contained in:
Andrew Tridgell 2018-05-25 08:56:15 +10:00
parent 92cda24659
commit 49dfccbcee
2 changed files with 19 additions and 2 deletions

View File

@ -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

View File

@ -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