|
|
|
@ -1,7 +1,6 @@
@@ -1,7 +1,6 @@
|
|
|
|
|
/****************************************************************************
|
|
|
|
|
* |
|
|
|
|
* Copyright (C) 2015 PX4 Development Team. All rights reserved. |
|
|
|
|
* Author: @author Nuno Marques <n.marques21@hotmail.com> |
|
|
|
|
* Copyright (C) 2013-2015 PX4 Development Team. All rights reserved. |
|
|
|
|
* |
|
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
|
|
* modification, are permitted provided that the following conditions |
|
|
|
@ -32,38 +31,47 @@
@@ -32,38 +31,47 @@
|
|
|
|
|
* |
|
|
|
|
****************************************************************************/ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @file distance_sensor.h |
|
|
|
|
* Definition of the distance sensor uORB topic. |
|
|
|
|
*/ |
|
|
|
|
/* Auto-generated by genmsg_cpp from file /home/nuno/px4/Firmware/msg/distance_sensor.msg */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef TOPIC_DISTANCE_SENSOR_H_ |
|
|
|
|
#define TOPIC_DISTANCE_SENSOR_H_ |
|
|
|
|
#pragma once |
|
|
|
|
|
|
|
|
|
#include <stdint.h> |
|
|
|
|
#include <stdbool.h> |
|
|
|
|
#include "../uORB.h" |
|
|
|
|
#include <uORB/uORB.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __cplusplus |
|
|
|
|
#define MAV_DISTANCE_SENSOR_LASER 0 |
|
|
|
|
#define MAV_DISTANCE_SENSOR_ULTRASOUND 1 |
|
|
|
|
#define MAV_DISTANCE_SENSOR_INFRARED 2 |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @addtogroup topics |
|
|
|
|
* @{ |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Distance sensor data, with range in centimeters (not in SI). |
|
|
|
|
* |
|
|
|
|
* @see http://en.wikipedia.org/wiki/International_System_of_Units
|
|
|
|
|
*/ |
|
|
|
|
struct distance_sensor_s { |
|
|
|
|
|
|
|
|
|
uint32_t time_boot_ms; /**< Time since system boot */ |
|
|
|
|
uint16_t min_distance; /**< Minimum distance the sensor can measure in centimeters */ |
|
|
|
|
uint16_t max_distance; /**< Maximum distance the sensor can measure in centimeters */ |
|
|
|
|
uint16_t current_distance; /**< Current distance reading */ |
|
|
|
|
uint8_t type; /**< Type from MAV_DISTANCE_SENSOR enum */ |
|
|
|
|
uint8_t id; /**< Onboard ID of the sensor */ |
|
|
|
|
uint8_t orientation; /**< Direction the sensor faces from MAV_SENSOR_ORIENTATION enum */ |
|
|
|
|
uint8_t covariance; /**< Measurement covariance in centimeters, 0 for unknown / invalid readings */ |
|
|
|
|
#ifdef __cplusplus |
|
|
|
|
struct __EXPORT distance_sensor_s { |
|
|
|
|
#else |
|
|
|
|
struct distance_sensor_s { |
|
|
|
|
#endif |
|
|
|
|
uint32_t time_boot_ms; |
|
|
|
|
uint16_t min_distance; |
|
|
|
|
uint16_t max_distance; |
|
|
|
|
uint16_t current_distance; |
|
|
|
|
uint8_t type; |
|
|
|
|
uint8_t id; |
|
|
|
|
uint8_t orientation; |
|
|
|
|
uint8_t covariance; |
|
|
|
|
#ifdef __cplusplus |
|
|
|
|
static const uint8_t MAV_DISTANCE_SENSOR_LASER = 0; |
|
|
|
|
static const uint8_t MAV_DISTANCE_SENSOR_ULTRASOUND = 1; |
|
|
|
|
static const uint8_t MAV_DISTANCE_SENSOR_INFRARED = 2; |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -72,5 +80,3 @@ struct distance_sensor_s {
@@ -72,5 +80,3 @@ struct distance_sensor_s {
|
|
|
|
|
|
|
|
|
|
/* register this as object request broker structure */ |
|
|
|
|
ORB_DECLARE(distance_sensor); |
|
|
|
|
|
|
|
|
|
#endif |