21 #ifndef DOXYGEN_OMIT_INTERNAL 26 std::shared_ptr<GroupCommandWrapper> internal_;
27 #endif // DOXYGEN_OMIT_INTERNAL 33 const size_t number_of_modules_;
37 std::vector<Command> commands_;
41 const bool is_subview_{};
46 GroupCommand(std::shared_ptr<GroupCommandWrapper>, std::vector<int> indices);
112 bool writeGains(
const std::string& file)
const;
121 auto res = hebiGroupCommandReadSafetyParameters(internal_->internal_, file.c_str()) == HebiStatusSuccess;
135 auto res = hebiGroupCommandWriteSafetyParameters(internal_->internal_, file.c_str()) == HebiStatusSuccess;
162 void setEffort(
const Eigen::VectorXd& effort);
199 void getEffort(Eigen::VectorXd& out)
const;
GroupCommand subview(std::vector< int > indices) const
Creates a "subview" of this group command object, with shared access to a subset of the Command eleme...
Definition: group_command.cpp:17
Eigen::VectorXd getPosition() const
Convenience function for returning commanded position values.
Definition: group_command.cpp:75
Command objects have various fields that can be set; when sent to the module, these fields control in...
Definition: command.hpp:34
bool writeGains(const std::string &file) const
Export the gains from this GroupCommand object into a file, creating it as necessary.
Definition: group_command.cpp:43
FunctionCallResult readSafetyParameters(const std::string &file)
Import the safety parameters from a file into this GroupCommand object.
Definition: group_command.hpp:118
Eigen::VectorXd getSpringConstant() const
Convenience function for returning commanded spring constant values.
Definition: group_command.cpp:99
Eigen::VectorXd getEffort() const
Convenience function for returning commanded effort values.
Definition: group_command.cpp:91
size_t size() const
Returns the number of module commands in this group command.
Definition: group_command.cpp:25
bool readGains(const std::string &file)
Import the gains from a file into this GroupCommand object.
Definition: group_command.cpp:37
Command & operator[](size_t index)
Access the command for an individual module.
Definition: group_command.cpp:27
Used as a return.
Definition: util.hpp:28
A list of Command objects appropriate for sending to a Group of modules; the size() must match the nu...
Definition: group_command.hpp:19
FunctionCallResult writeSafetyParameters(const std::string &file) const
Export the safety parameters from this GroupCommand object into a file, creating it as necessary.
Definition: group_command.hpp:132
bool isSubview() const
Was this created as a subview of another GroupCommand?
Definition: group_command.hpp:79
void setVelocity(const Eigen::VectorXd &velocity)
Convenience function for setting velocity commands from Eigen vectors.
Definition: group_command.cpp:55
void setSpringConstant(const Eigen::VectorXd &springConstant)
Convenience function for setting spring constant commands from Eigen vectors.
Definition: group_command.cpp:68
void setPosition(const Eigen::VectorXd &position)
Convenience function for setting position commands from Eigen vectors.
Definition: group_command.cpp:49
~GroupCommand() noexcept=default
Destructor cleans up group command object as necessary.
void setEffort(const Eigen::VectorXd &effort)
Convenience function for setting effort commands from Eigen vectors.
Definition: group_command.cpp:61
void clear()
Clears all data in this GroupCommand object; this returns to the state the GroupCommand was at time o...
Definition: group_command.cpp:31
Eigen::VectorXd getVelocity() const
Convenience function for returning commanded velocity values.
Definition: group_command.cpp:83