| pnd-cpp-sdk 1.5.1

Loading...
Searching...
No Matches
groupCommand.hpp
1#pragma once
2
3#include <memory>
4#include <vector>
5
6#include "aios.h"
7
8 namespace Pnd {
9
14 class GroupCommand final {
15 public:
19 GroupCommand(size_t number_of_modules);
20
24 ~GroupCommand() noexcept;
25
29 size_t size() const;
30
34 PndCommandPtr operator[](size_t index);
35
39 const PndCommandPtr operator[](size_t index) const;
40
45 void clear();
46
52 void setPosition(const std::vector<float> &position);
53
60 void setTrapezoidalMove(const std::vector<float> &val);
61
67 void setVelocity(const std::vector<float> &velocity);
68
75 void setVelocityRamp(const std::vector<float> &velocity);
76
82 void setCurrent(const std::vector<float> &effort);
83
90 void enable(const std::vector<float> &status);
91
97 void reboot(const std::vector<bool> &flag);
98
104 void getError(const std::vector<bool> &flag);
105
111 void clearError(const std::vector<bool> &flag);
112
119 void resetLinearCount(const std::vector<float> &linearCount);
120
127 void setMotionCtrlConfig(const std::vector<MotionControllerConfig *> &config);
128
135 void setMotorConfig(const std::vector<MotorConfig *> &config);
136
143 void setTrapTraj(const std::vector<TrapTraj *> &config);
144
150 void saveConfig(const std::vector<bool> &flag);
151
158 void setNetworkSetting(const std::vector<NetworkSetting *> &config);
159
163 void getMotorRotorAbsPos(const std::vector<bool> &flag);
164
165 // For latency test
166 void setLatencyTest(const std::vector<bool> &flag);
167
168 /******* fw2 .0 *******/
169 void setInputPositionPt(const std::vector<PosPtInfo> &param);
170
171 void setInputVelocityPt(const std::vector<float> &param);
172
173 void setInputTorquePt(const std::vector<float> &param);
174 /******* fw2 .0 *******/
175
182 void RcuPower(const std::vector<bool> &status);
183 void RcuAV5VPower(const std::vector<bool> &status);
184 void RcuV5VPower(const std::vector<bool> &status);
185 void RcuV5VAPower(const std::vector<bool> &status);
186 void RcuV5VBPower(const std::vector<bool> &status);
187 void Rcu12VPower(const std::vector<bool> &status);
188 void RcuFan12VPower(const std::vector<bool> &status);
189 void Rcu19VPower(const std::vector<bool> &status);
190
191 void RcuBrakeCmd(const std::vector<RcuBrake> &param);
192 void RcuAdcOffset(const std::vector<float> &param);
193 void RcuFwUpgrade();
194
195 // Encoder
196 void getEncoderAngle(const std::vector<float> &param);
197
198 public:
203 PndGroupCommandPtr internal_;
204
208 const size_t number_of_modules_;
209
210 private:
214 std::vector<PndCommandPtr> commands_;
215};
216
217} // namespace Pnd
Pnd::GroupCommand
A list of Command objects appropriate for sending to a Group of modules; the size() must match the nu...
Definition groupCommand.hpp:14
Pnd::GroupCommand::setVelocity
void setVelocity(const std::vector< float > &velocity)
Convenience function for setting velocity commands from vectors.
Definition groupCommand.cpp:37
Pnd::GroupCommand::operator[]
PndCommandPtr operator[](size_t index)
Access the command for an individual module.
Definition groupCommand.cpp:16
Pnd::GroupCommand::setMotorConfig
void setMotorConfig(const std::vector< MotorConfig * > &config)
Convenience function for setting setMotorConfig commands from vectors.
Definition groupCommand.cpp:107
Pnd::GroupCommand::RcuPower
void RcuPower(const std::vector< bool > &status)
Convenience function for setting ctrlBoxEnable commands from vectors.
Definition groupCommand.cpp:182
Pnd::GroupCommand::enable
void enable(const std::vector< float > &status)
Convenience function for setting enable commands from vectors.
Definition groupCommand.cpp:59
Pnd::GroupCommand::setTrapezoidalMove
void setTrapezoidalMove(const std::vector< float > &val)
Convenience function for setting TrapezoidalMove commands from vectors.
Definition groupCommand.cpp:30
Pnd::GroupCommand::resetLinearCount
void resetLinearCount(const std::vector< float > &linearCount)
Convenience function for setting resetLinearCount commands from vectors.
Definition groupCommand.cpp:91
Pnd::GroupCommand::setTrapTraj
void setTrapTraj(const std::vector< TrapTraj * > &config)
Convenience function for setting setTrapTraj commands from vectors.
Definition groupCommand.cpp:115
Pnd::GroupCommand::setMotionCtrlConfig
void setMotionCtrlConfig(const std::vector< MotionControllerConfig * > &config)
Convenience function for setting setMotionCtrlConfig commands from vectors.
Definition groupCommand.cpp:99
Pnd::GroupCommand::saveConfig
void saveConfig(const std::vector< bool > &flag)
Convenience function for setting saveConfig commands from vectors.
Definition groupCommand.cpp:123
Pnd::GroupCommand::setVelocityRamp
void setVelocityRamp(const std::vector< float > &velocity)
Convenience function for setting velocity ramp commands from vectors.
Definition groupCommand.cpp:44
Pnd::GroupCommand::internal_
PndGroupCommandPtr internal_
Definition groupCommand.hpp:203
Pnd::GroupCommand::setCurrent
void setCurrent(const std::vector< float > &effort)
Convenience function for setting current commands from vectors.
Definition groupCommand.cpp:51
Pnd::GroupCommand::setPosition
void setPosition(const std::vector< float > &position)
Convenience function for setting position commands from vectors.
Definition groupCommand.cpp:22
Pnd::GroupCommand::getMotorRotorAbsPos
void getMotorRotorAbsPos(const std::vector< bool > &flag)
Get Motor rotor absolute position.
Definition groupCommand.cpp:139
Pnd::GroupCommand::size
size_t size() const
Returns the number of module commands in this group command.
Definition groupCommand.cpp:14
Pnd::GroupCommand::number_of_modules_
const size_t number_of_modules_
Definition groupCommand.hpp:208
Pnd::GroupCommand::~GroupCommand
~GroupCommand() noexcept
Destructor cleans up group command object as necessary.
Definition groupCommand.cpp:10
Pnd::GroupCommand::clear
void clear()
Clears all data in this GroupCommand object; this returns to the state the GroupCommand was at time o...
Definition groupCommand.cpp:20
Pnd::GroupCommand::getError
void getError(const std::vector< bool > &flag)
Convenience function for setting getError commands from vectors.
Definition groupCommand.cpp:75
Pnd::GroupCommand::reboot
void reboot(const std::vector< bool > &flag)
Convenience function for setting reboot commands from vectors.
Definition groupCommand.cpp:67
Pnd::GroupCommand::setNetworkSetting
void setNetworkSetting(const std::vector< NetworkSetting * > &config)
Convenience function for setting setNetworkSetting commands from vectors.
Definition groupCommand.cpp:131
Pnd::GroupCommand::clearError
void clearError(const std::vector< bool > &flag)
Convenience function for setting clearError commands from vectors.
Definition groupCommand.cpp:83