Skip to content

Commit ba2605e

Browse files
committed
Add: Hold offsets in ServoArray
1 parent 13f36cf commit ba2605e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/include/servoarray/servoarray.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ class ServoArray {
3434
std::shared_ptr<Driver> driver_;
3535
ReadMode read_mode_ = ReadMode::Direct;
3636

37+
std::vector<double> offsets_;
3738
std::vector<double> cache_;
3839

3940
public:
40-
ServoArray(std::shared_ptr<Driver>);
41+
ServoArray(std::shared_ptr<Driver>, const std::vector<double>& offsets = {});
4142
ServoArray(const std::string& name = "", const DriverParams& = {}, DriverManager& = default_manager);
4243

4344
void write(std::size_t index, double rad);

src/lib/servoarray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace ServoArray {
2222

23-
ServoArray::ServoArray(std::shared_ptr<Driver> driver) : driver_(driver) {
23+
ServoArray::ServoArray(std::shared_ptr<Driver> driver, const std::vector<double>& offsets) : driver_(driver), offsets_(offsets) {
2424
this->cache_.resize(this->size());
2525
}
2626

0 commit comments

Comments
 (0)