| pnd-cpp-sdk 1.0.0

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
166 void ctrlBoxEnable(const std::vector<float> &status);
167
168 // For latency test
169 void setLatencyTest(const std::vector<bool> &flag);
170
171 /******* fw2 .0 *******/
172 void setInputPositionPt(const std::vector<PosPtInfo> &param);
173
174 void setInputVelocityPt(const std::vector<float> &param);
175
176 void setInputTorquePt(const std::vector<float> &param);
177 /******* fw2 .0 *******/
178
179 public:
184 PndGroupCommandPtr internal_;
185
189 const size_t number_of_modules_;
190
191 private:
195 std::vector<PndCommandPtr> commands_;
196};
197
198} // 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:43
Pnd::GroupCommand::operator[]
PndCommandPtr operator[](size_t index)
Access the command for an individual module.
Definition groupCommand.cpp:18
Pnd::GroupCommand::setMotorConfig
void setMotorConfig(const std::vector< MotorConfig * > &config)
Convenience function for setting setMotorConfig commands from vectors.
Definition groupCommand.cpp:114
Pnd::GroupCommand::ctrlBoxEnable
void ctrlBoxEnable(const std::vector< float > &status)
Convenience function for setting ctrlBoxEnable commands from vectors.
Definition groupCommand.cpp:148
Pnd::GroupCommand::enable
void enable(const std::vector< float > &status)
Convenience function for setting enable commands from vectors.
Definition groupCommand.cpp:65
Pnd::GroupCommand::setTrapezoidalMove
void setTrapezoidalMove(const std::vector< float > &val)
Convenience function for setting TrapezoidalMove commands from vectors.
Definition groupCommand.cpp:36
Pnd::GroupCommand::resetLinearCount
void resetLinearCount(const std::vector< float > &linearCount)
Convenience function for setting resetLinearCount commands from vectors.
Definition groupCommand.cpp:97
Pnd::GroupCommand::setTrapTraj
void setTrapTraj(const std::vector< TrapTraj * > &config)
Convenience function for setting setTrapTraj commands from vectors.
Definition groupCommand.cpp:122
Pnd::GroupCommand::setMotionCtrlConfig
void setMotionCtrlConfig(const std::vector< MotionControllerConfig * > &config)
Convenience function for setting setMotionCtrlConfig commands from vectors.
Definition groupCommand.cpp:105
Pnd::GroupCommand::saveConfig
void saveConfig(const std::vector< bool > &flag)
Convenience function for setting saveConfig commands from vectors.
Definition groupCommand.cpp:130
Pnd::GroupCommand::setVelocityRamp
void setVelocityRamp(const std::vector< float > &velocity)
Convenience function for setting velocity ramp commands from vectors.
Definition groupCommand.cpp:50
Pnd::GroupCommand::internal_
PndGroupCommandPtr internal_
Definition groupCommand.hpp:184
Pnd::GroupCommand::setCurrent
void setCurrent(const std::vector< float > &effort)
Convenience function for setting current commands from vectors.
Definition groupCommand.cpp:57
Pnd::GroupCommand::setPosition
void setPosition(const std::vector< float > &position)
Convenience function for setting position commands from vectors.
Definition groupCommand.cpp:28
Pnd::GroupCommand::size
size_t size() const
Returns the number of module commands in this group command.
Definition groupCommand.cpp:16
Pnd::GroupCommand::number_of_modules_
const size_t number_of_modules_
Definition groupCommand.hpp:189
Pnd::GroupCommand::~GroupCommand
~GroupCommand() noexcept
Destructor cleans up group command object as necessary.
Definition groupCommand.cpp:12
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:26
Pnd::GroupCommand::getError
void getError(const std::vector< bool > &flag)
Convenience function for setting getError commands from vectors.
Definition groupCommand.cpp:81
Pnd::GroupCommand::reboot
void reboot(const std::vector< bool > &flag)
Convenience function for setting reboot commands from vectors.
Definition groupCommand.cpp:73
Pnd::GroupCommand::setNetworkSetting
void setNetworkSetting(const std::vector< NetworkSetting * > &config)
Convenience function for setting setNetworkSetting commands from vectors.
Definition groupCommand.cpp:138
Pnd::GroupCommand::clearError
void clearError(const std::vector< bool > &flag)
Convenience function for setting clearError commands from vectors.
Definition groupCommand.cpp:89