RBCX
Library for the RB3204-RBCX board with the ESP32 by RoboticsBrno.
Loading...
Searching...
No Matches
RBCXStupidServo.h
Go to the documentation of this file.
1#pragma once
2
3#include <mutex>
4#include <stdint.h>
5
6#include "rbcx.pb.h"
7
8namespace rb {
9
10class Manager;
11
13 friend class Manager;
14
15public:
16 uint8_t id() const { return m_id; }
17
19 void setPosition(float positionFraction);
20
22 float position() const { return m_lastPosition; }
23
25 void disable();
26
27private:
28 StupidServo(uint8_t id);
29 ~StupidServo() {}
30 StupidServo(const StupidServo&) = delete;
31
32 void sendServoMsg(float position);
33
34 std::mutex m_mutex;
35 float m_lastPosition;
36 uint8_t m_id;
37};
38
39};
The main library class for working with the RBCX board. Call the install() method at the start of you...
Definition: RBCXManager.h:61
Definition: RBCXStupidServo.h:12
void disable()
Definition: RBCXStupidServo.cpp:11
void setPosition(float positionFraction)
Returns last set position (can be NaN if disabled)
Definition: RBCXStupidServo.cpp:9
uint8_t id() const
set servo posiotion, range is <0;1>. Some servos might accept a bit more
Definition: RBCXStupidServo.h:16
float position() const
Disables servo.
Definition: RBCXStupidServo.h:22
Definition: RBCXAngle.cpp:3