42 #include <moveit_msgs/msg/motion_sequence_request.hpp>
60 void add(
const CmdVariant& cmd,
const double blend_radius = 0.);
68 T&
getCmd(
const size_t index_cmd);
71 const T&
getCmd(
const size_t index_cmd)
const;
88 void setBlendRadius(
const size_t index_cmd,
const double blend_radius);
94 void erase(
const size_t start,
const size_t end);
96 moveit_msgs::msg::MotionSequenceRequest
toRequest()
const;
99 using TCmdRadiiPair = std::pair<CmdVariant, double>;
100 std::vector<TCmdRadiiPair> cmds_;
105 cmds_.emplace_back(cmd, blend_radius);
116 return std::get<T>(cmds_.at(index_cmd).first);
122 return std::get<T>(cmds_.at(index_cmd).first);
127 return cmds_.at(index_cmd).second;
132 cmds_.at(index_cmd).second = blend_radius;
137 std::for_each(cmds_.begin(), cmds_.end(), [](TCmdRadiiPair& cmd) { cmd.second = 0.; });
143 return std::holds_alternative<T>(cmds_.at(index_cmd).first);
Base class for commands storing all general information of a command.
Data class storing all information regarding a Sequence command.
size_t size() const
Returns the number of commands.
T & getCmd(const size_t index_cmd)
void setAllBlendRadiiToZero()
bool cmdIsOfType(const size_t index_cmd) const
void setBlendRadius(const size_t index_cmd, const double blend_radius)
void erase(const size_t start, const size_t end)
Deletes all commands from index 'start' to index 'end'.
void add(const CmdVariant &cmd, const double blend_radius=0.)
Adds a command to the end of the sequence.
double getBlendRadius(const size_t index_cmd) const
moveit_msgs::msg::MotionSequenceRequest toRequest() const
std::variant< PtpJoint, PtpJointCart, PtpCart, LinJoint, LinCart, CircCenterCart, CircInterimCart, CircJointCenterCart, CircJointInterimCart, Gripper > CmdVariant