bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
ultrasound.h
Go to the documentation of this file.
1//
2// Created by alex on 11/23/25.
3//
4
5#ifndef BITSIM_SENSORS_MESSAGES_ULTRASOUND_H
6#define BITSIM_SENSORS_MESSAGES_ULTRASOUND_H
7
10#include <optional>
11#include <string>
12
13namespace bitsim
14{
15namespace sensors
16{
17
29{
32
34 std::string unit_str{"m"};
35
37 real_t metres() const;
38
40 static std::optional<UltrasoundMessage> parse(const std::string &msg);
41};
42} // namespace sensors
43} // namespace bitsim
44
45#endif // BITSIM_SENSORS_MESSAGES_ULTRASOUND_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
Definition infrared_line_follower.h:9
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20
Definition message_base.h:15
Models a message from an ultrasound sensor:
Definition ultrasound.h:29
real_t distance
The distance as the message gives it, in unit_str.
Definition ultrasound.h:31
real_t metres() const
Definition ultrasound.cpp:31
std::string unit_str
The unit of distance.
Definition ultrasound.h:34
static std::optional< UltrasoundMessage > parse(const std::string &msg)
Definition ultrasound.cpp:33