libstp
Robotics library for Botball
Loading...
Searching...
No Matches
MapSegment.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cmath>
4
#include <cstdint>
5
6
namespace
libstp::map
7
{
12
struct
MapSegment
13
{
14
enum class
Kind
: uint8_t {
Line
,
Wall
};
15
16
Kind
kind
{
Kind::Line
};
17
float
startX
{0.0f};
18
float
startY
{0.0f};
19
float
endX
{0.0f};
20
float
endY
{0.0f};
21
float
widthCm
{0.0f};
22
26
float
length
() const noexcept
27
{
28
return
std::hypot(
endX
-
startX
,
endY
-
startY
);
29
}
30
};
31
}
libstp::map
Definition
Geometry.hpp:8
libstp::map::MapSegment
Definition
MapSegment.hpp:13
libstp::map::MapSegment::endX
float endX
Definition
MapSegment.hpp:19
libstp::map::MapSegment::startX
float startX
Definition
MapSegment.hpp:17
libstp::map::MapSegment::kind
Kind kind
Definition
MapSegment.hpp:16
libstp::map::MapSegment::startY
float startY
Definition
MapSegment.hpp:18
libstp::map::MapSegment::length
float length() const noexcept
Definition
MapSegment.hpp:26
libstp::map::MapSegment::endY
float endY
Definition
MapSegment.hpp:20
libstp::map::MapSegment::widthCm
float widthCm
Definition
MapSegment.hpp:21
libstp::map::MapSegment::Kind
Kind
Definition
MapSegment.hpp:14
libstp::map::MapSegment::Kind::Line
@ Line
Definition
MapSegment.hpp:14
libstp::map::MapSegment::Kind::Wall
@ Wall
Definition
MapSegment.hpp:14
modules
libstp-map
include
libstp
map
MapSegment.hpp
Generated by
1.15.0