mirror of
https://github.com/BotChain-Robots/control.git
synced 2026-03-10 00:32:26 +01:00
Add default implementation in Module class
This commit is contained in:
22
src/Hub.cpp
22
src/Hub.cpp
@@ -1,28 +1,6 @@
|
||||
#include "Hub.h"
|
||||
#include "flatbuffers/SensorMessageBuilder.h"
|
||||
|
||||
double Hub::get_position() {
|
||||
// no-op
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string Hub::get_text() {
|
||||
// no-op
|
||||
return "";
|
||||
}
|
||||
|
||||
void Hub::actuate(double /* position */) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
void Hub::actuate(double /* x */, double /* y */) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
void Hub::actuate(const std::string &text) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
std::vector<uint8_t> Hub::get_actuation_message() {
|
||||
// no-op
|
||||
return {};
|
||||
|
||||
@@ -41,3 +41,25 @@ void Module::update_module_metadata(const Messaging::TopologyMessage &message) {
|
||||
m_neighbours.emplace_back(neighbour{id, static_cast<Orientation>(ori)});
|
||||
}
|
||||
}
|
||||
|
||||
double Module::get_position() {
|
||||
// no-op
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string Module::get_text() {
|
||||
// no-op
|
||||
return "";
|
||||
}
|
||||
|
||||
void Module::actuate(double /* position */) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
void Module::actuate(double /* x */, double /* y */) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
void Module::actuate(const std::string &text) {
|
||||
// no-op
|
||||
}
|
||||
|
||||
@@ -10,10 +10,6 @@ double BoundedPositionalActuator1D::get_position() {
|
||||
return m_current_position;
|
||||
}
|
||||
|
||||
std::string BoundedPositionalActuator1D::get_text() {
|
||||
return "";
|
||||
}
|
||||
|
||||
void BoundedPositionalActuator1D::actuate(double position) {
|
||||
if (position < m_min_value || position > m_max_value) {
|
||||
return;
|
||||
@@ -22,12 +18,6 @@ void BoundedPositionalActuator1D::actuate(double position) {
|
||||
m_target_position = position;
|
||||
}
|
||||
|
||||
void BoundedPositionalActuator1D::actuate(double x, double y) {
|
||||
}
|
||||
|
||||
void BoundedPositionalActuator1D::actuate(const std::string &text) {
|
||||
}
|
||||
|
||||
std::vector<uint8_t> BoundedPositionalActuator1D::get_actuation_message() {
|
||||
std::vector<uint8_t> message{};
|
||||
|
||||
|
||||
@@ -3,20 +3,10 @@
|
||||
#include "util/Variant.h"
|
||||
#include <cstring>
|
||||
|
||||
double OledActuator::get_position() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
std::string OledActuator::get_text() {
|
||||
return m_current_text;
|
||||
}
|
||||
|
||||
void OledActuator::actuate(double /* position */) {
|
||||
}
|
||||
|
||||
void OledActuator::actuate(double /* x */, double /* y */) {
|
||||
}
|
||||
|
||||
void OledActuator::actuate(const std::string &text) {
|
||||
m_target_text = text;
|
||||
}
|
||||
|
||||
@@ -7,20 +7,10 @@ double PositionalActuator1D::get_position() {
|
||||
return m_current_position;
|
||||
}
|
||||
|
||||
std::string PositionalActuator1D::get_text() {
|
||||
return "";
|
||||
}
|
||||
|
||||
void PositionalActuator1D::actuate(double position) {
|
||||
m_target_position = position;
|
||||
}
|
||||
|
||||
void PositionalActuator1D::actuate(double /* x */, double /* y */) {
|
||||
}
|
||||
|
||||
void PositionalActuator1D::actuate(const std::string &text) {
|
||||
}
|
||||
|
||||
std::vector<uint8_t> PositionalActuator1D::get_actuation_message() {
|
||||
std::vector<uint8_t> message{};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user