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>();
77 ev->trajectory = traj;
83 ev->trajectory = traj;
88 RCLCPP_INFO_STREAM(
getLogger(),
"[" << this->
getName() <<
"] motion execution failed");
90 this->postEvent<EvMoveGroupMotionExecutionFailed<TSourceObject, TOrthogonal>>();
94 virtual void onEntry()
override;
96 virtual void onExit()
override;
98 virtual void update()
override;
102 moveit_msgs::msg::RobotTrajectory & computedJointTrajectory);
105 const moveit_msgs::msg::RobotTrajectory & computedJointTrajectory);
118 std::string globalFrame, tf2::Stamped<tf2::Transform> & currentEndEffectorTransform);
123 rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr
markersPub_;
127 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_
CbMoveEndEffectorTrajectory(std::optional< std::string > tipLink=std::nullopt)
ClMoveGroup * movegroupClient_
void executeJointSpaceTrajectory(const moveit_msgs::msg::RobotTrajectory &computedJointTrajectory)
void postEventMotionExecutionFailed()
std::string getName() const
virtual rclcpp::Logger getLogger()
ComputeJointTrajectoryErrorCode
@ INCORRECT_INITIAL_STATE
@ JOINT_TRAJECTORY_DISCONTINUITY
moveit_msgs::msg::RobotTrajectory trajectory
moveit_msgs::msg::RobotTrajectory trajectory