Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
range_sensor_uavcan.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 Freek van Tienen <freek.v.tienen@gmail.com>
3 *
4 * This file is part of paparazzi
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
26#include "range_sensor_uavcan.h"
27#include "uavcan/uavcan.h"
28#include "core/abi.h"
29#include "uavcan.equipment.range_sensor.Measurement.h"
30
31
32/* Local variables */
35
36#if PERIODIC_TELEMETRY
38
40{
41 uint8_t nul = 0;
44 &range_sensor_uavcan.reading_type,
45 &nul);
46}
47
48#endif
49
52 return; // decode error
53 }
54
55 // Send the range over ABI
56 if(!isnan(range_sensor_uavcan.range)) {
59 }
60}
61
Main include for ABI (AirBorneInterface).
#define AGL_UAVCAN_ID
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Main uavcan event structure for registering/calling callbacks.
Definition uavcan.h:60
uint16_t foo
Definition main_demo5.c:58
static struct uavcan_equipment_range_sensor_Measurement range_sensor_uavcan
static void range_sensor_uavcan_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
void range_sensor_uavcan_init(void)
static uavcan_event range_sensor_uavcan_ev
static void range_sensor_uavcan_send_lidar(struct transport_tx *trans, struct link_device *dev)
Range sensor sensor on the uavcan bus.
uavcan interface structure
Definition uavcan.h:34
static const struct usb_device_descriptor dev
Definition usb_ser_hw.c:74
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition telemetry.c:51
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Definition telemetry.h:66
void uavcan_bind(uint16_t data_type_id, uint64_t data_type_signature, uavcan_event *ev, uavcan_callback cb)
Bind to a receiving message from uavcan.
Definition uavcan.c:417
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
int transfer(const Mat *from, const image_t *to)