23#include <tf2/transform_datatypes.h>
25#include <moveit_msgs/srv/get_position_ik.hpp>
27#include <visualization_msgs/msg/marker_array.hpp>
31template <
typename AsyncCB,
typename Orthogonal>
37template <
typename AsyncCB,
typename Orthogonal>
65 const std::vector<geometry_msgs::msg::PoseStamped> & endEffectorTrajectory,
66 std::optional<std::string> tipLink = std::nullopt);
68 template <
typename TOrthogonal,
typename TSourceObject>
73 smacc2::SmaccAsyncClientBehavior::onOrthogonalAllocation<TOrthogonal, TSourceObject>();
78 ev->trajectory = traj;
85 ev->trajectory = traj;
91 RCLCPP_INFO_STREAM(
getLogger(),
"[" << this->
getName() <<
"] motion execution failed");
93 this->postEvent<EvMoveGroupMotionExecutionFailed<TSourceObject, TOrthogonal>>();
97 virtual void onEntry()
override;
99 virtual void onExit()
override;
101 virtual void update()
override;
105 moveit_msgs::msg::RobotTrajectory & computedJointTrajectory);
108 const moveit_msgs::msg::RobotTrajectory & computedJointTrajectory);
121 std::string globalFrame, tf2::Stamped<tf2::Transform> & currentEndEffectorTransform);
126 rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr
markersPub_;
130 rclcpp::Client<moveit_msgs::srv::GetPositionIK>::SharedPtr
iksrv_;
ComputeJointTrajectoryErrorCode computeJointSpaceTrajectory(moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
std::function< void(moveit_msgs::msg::RobotTrajectory &)> postIncorrectInitialStateEvent
std::optional< bool > allowInitialTrajectoryStateJointDiscontinuity_
std::optional< std::string > tipLink_
virtual void createMarkers()
virtual void onExit() override
virtual void update() override
void getCurrentEndEffectorPose(std::string globalFrame, tf2::Stamped< tf2::Transform > ¤tEndEffectorTransform)
std::function< void(moveit_msgs::msg::RobotTrajectory &)> postJointDiscontinuityEvent
std::function< void()> postMotionExecutionFailureEvents
std::vector< geometry_msgs::msg::PoseStamped > endEffectorTrajectory_
std::optional< std::string > group_
rclcpp::Publisher< visualization_msgs::msg::MarkerArray >::SharedPtr markersPub_
void onOrthogonalAllocation()
virtual void onEntry() override
virtual void generateTrajectory()=0
rclcpp::Client< moveit_msgs::srv::GetPositionIK >::SharedPtr iksrv_
visualization_msgs::msg::MarkerArray beahiorMarkers_
std::atomic< bool > markersInitialized_
ClMoveGroup * movegroupClient_
void executeJointSpaceTrajectory(const moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
void postEventMotionExecutionFailed()
std::string getName() const
virtual rclcpp::Logger getLogger() const
ComputeJointTrajectoryErrorCode
@ INCORRECT_INITIAL_STATE
@ JOINT_TRAJECTORY_DISCONTINUITY
moveit_msgs::msg::RobotTrajectory trajectory
moveit_msgs::msg::RobotTrajectory trajectory