14 using JointMap = std::map<std::string, std::shared_ptr<Joint>>;
29 auto contains = [](
const auto& haystack,
const auto& needle) {
30 return haystack.find(needle) != std::string::npos;
35 for (
auto& joint : joints) {
36 if (
contains(joint.first,
"_finger_joint")) {
39 if (joint.second->control_method) {
53 ROS_WARN(
"User stop pressed, stopping robot");
59 for (
auto& joint : joints) {
60 if (
contains(joint.first,
"_finger_joint")) {
63 joint.second->stop_position = joint.second->position;
64 joint.second->desired_position = joint.second->position;
65 joint.second->desired_velocity = 0;
71 using namespace boost::sml;
72 return make_transition_table(
75 state<Idle> + event<UserStop>[
isPressed] /
stop = state<UserStopped>,
76 state<Idle> + event<ErrorRecovery> /
start = state<Move>,
77 state<Move> + event<SwitchControl>[
isStopping] /
idle = state<Idle>,
78 state<Move> + event<UserStop>[
isPressed] /
stop = state<UserStopped>,
79 state<UserStopped> + event<UserStop>[
isReleased] /
idle = state<Idle>
std::array< double, 7 > q_d
std::map< std::string, std::shared_ptr< Joint > > JointMap
std::array< double, 7 > q
std::array< double, 7 > dq_d
std::array< double, 7 > ddq_d