CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
sensors_interface.hpp
1// Copyright (C) 2024 Avular Holding B.V. - All Rights Reserved
2// You may use this code under the terms of the Avular
3// Software End-User License Agreement.
4//
5// You should have received a copy of the Avular
6// Software End-User License Agreement license with
7// this file, or download it from: avular.com/eula
8//
9/*****************************************************************************
10 * Created on: 2024 July 18
11 * Author: Robbert-Jan de Jager
12 *
13 * The interface for the sensors of the Avular Robot.
14 ****************************************************************************/
15#pragma once
16
17#include <creos/client_global.hpp>
18#include <creos/messages/barometer.hpp>
19#include <creos/messages/controller_state.hpp>
20#include <creos/messages/gnss.hpp>
21#include <creos/messages/imu.hpp>
22#include <creos/messages/interface_info.hpp>
23#include <creos/messages/magnetic_field.hpp>
24#include <creos/messages/odometry.hpp>
25#include <creos/messages/point_cloud2.hpp>
26#include <creos/messages/pose.hpp>
27#include <creos/messages/range.hpp>
28#include <creos/messages/wheel_state.hpp>
29#include <creos/subscription.hpp>
30
31namespace creos {
32
36class CREOS_CLIENT_API ISensorsInterface {
37public:
38 static constexpr char name[] = "sensors";
39 static constexpr unsigned version = 1;
40
41 virtual ~ISensorsInterface() = default;
42
56 const creos_messages::Lidar3dId lidar_id,
57 const std::function<void(const creos_messages::PointCloud2&)>& callback) = 0;
58
71 const std::function<void(const creos_messages::Odometry&)>& callback) = 0;
72
85 const std::function<void(const creos_messages::PoseWithCovarianceStamped&)>& callback) = 0;
86
99 virtual SubscriptionId subscribeToGnss(const std::function<void(const creos_messages::Gnss&)>& callback) = 0;
100
114 const std::function<void(const creos_messages::ControllerState&)>& callback) = 0;
115
125 const std::function<void(const creos_messages::WheelStates&)>& callback) = 0;
126
139 creos_messages::MagneticFieldId magnetic_field_id,
140 const std::function<void(const creos_messages::MagneticField&)>& callback) = 0;
141
154 const std::function<void(const creos_messages::Barometer&)>& callback) = 0;
155
168 creos_messages::RangeSensorId range_sensor_id,
169 const std::function<void(const creos_messages::Range&)>& callback) = 0;
170
184 const std::function<void(const creos_messages::Imu&)>& callback) = 0;
185};
186
187} // namespace creos
The interface for retrieving sensor data from an Avular robot.
Definition sensors_interface.hpp:36
virtual SubscriptionId subscribeToRemoteController(const std::function< void(const creos_messages::ControllerState &)> &callback)=0
Subscribe to the remote controller state data.
virtual SubscriptionId subscribeToGnss(const std::function< void(const creos_messages::Gnss &)> &callback)=0
Subscribe to the GNSS data.
virtual SubscriptionId subscribeToOdometry(const std::function< void(const creos_messages::Odometry &)> &callback)=0
Subscribe to the odometry data.
virtual SubscriptionId subscribeToRangeSensor(creos_messages::RangeSensorId range_sensor_id, const std::function< void(const creos_messages::Range &)> &callback)=0
Subscribe to range sensor data.
virtual SubscriptionId subscribeToWheelState(const std::function< void(const creos_messages::WheelStates &)> &callback)=0
Subscribe to the wheel state data.
virtual SubscriptionId subscribeToImu(const creos_messages::ImuId imu_id, const std::function< void(const creos_messages::Imu &)> &callback)=0
Subscribe to the IMU sensor data.
virtual SubscriptionId subscribeToMagneticField(creos_messages::MagneticFieldId magnetic_field_id, const std::function< void(const creos_messages::MagneticField &)> &callback)=0
Subscribe to the magnetic field data.
virtual SubscriptionId subscribeToBarometer(const std::function< void(const creos_messages::Barometer &)> &callback)=0
Subscribe to the barometer data.
virtual SubscriptionId subscribeToPose(const std::function< void(const creos_messages::PoseWithCovarianceStamped &)> &callback)=0
Subscribe to the global pose data.
virtual SubscriptionId subscribeTo3dLidar(const creos_messages::Lidar3dId lidar_id, const std::function< void(const creos_messages::PointCloud2 &)> &callback)=0
Subscribe to the lidar point cloud data.
This type holds an subscription ID.
Definition subscription.hpp:22
ImuId
IMU sensor id.
Definition imu.hpp:83
RangeSensorId
Range sensor id.
Definition range.hpp:82
Lidar3dId
The Lidar3dId enum class contains the different lidar 3D sensors.
Definition point_cloud2.hpp:160
MagneticFieldId
The MagneticFieldId enum contains the different magnetic field sensors that can be used.
Definition magnetic_field.hpp:61
The main namespace for the CreOS client library.
Barometer message containing the pressure and temperature.
Definition barometer.hpp:28
Remote control message containing the remote controller state.
Definition controller_state.hpp:29
The GNSS message contains the GNSS data of the robot.
Definition gnss.hpp:97
IMU message containing the orientation, angular velocity and linear acceleration.
Definition imu.hpp:29
Magnetic field message containing the magnetic field strength.
Definition magnetic_field.hpp:28
The Odometry message contains the estimated position, orientation and velocity of the robot.
Definition odometry.hpp:32
The PointCloud2 message contains a 3D point cloud.
Definition point_cloud2.hpp:74
The PoseWithCovarianceStamped message contains a position and orientation with a covariance matrix an...
Definition pose.hpp:68
Range message containing the range measurement of a sensor.
Definition range.hpp:28
Wheel state message containing the position and velocity of the wheels.
Definition wheel_state.hpp:51