23 choreo_msgs::TrajectoryExecution::Response>(
35 choreo_msgs::TrajectoryExecution::Request& req, choreo_msgs::TrajectoryExecution::Response& res)
40 ROS_ERROR_STREAM(
"[FF Simulation Execution] Simulation Execution Action server is not connected.");
44 if (req.trajectory.points.empty())
46 ROS_WARN_STREAM(
"[FF Simulation Execution] Trajectory Execution Service recieved an empty trajectory.");
51 control_msgs::FollowJointTrajectoryGoal goal;
52 goal.trajectory = req.trajectory;
55 if (req.wait_for_execution)
59 if (
ac_.
waitForResult(goal.trajectory.points.back().time_from_start + extra_wait))
65 ROS_ERROR_STREAM(__FUNCTION__ <<
": Goal failed or did not complete in time.");
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
SimulationExecutionService(ros::NodeHandle &nh)
bool waitForResult(const ros::Duration &timeout=ros::Duration(0, 0))
static const double ACTION_EXTRA_WAIT_RATIO
static const std::string ACTION_SERVER_NAME
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
static const char *const ACTION_CONNECTION_FAILED_MSG
bool isServerConnected() const
static const double ACTION_SERVICE_WAIT_TIME
#define ROS_WARN_STREAM(args)
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
actionlib::SimpleActionClient< control_msgs::FollowJointTrajectoryAction > ac_
ros::ServiceServer server_
SimpleClientGoalState getState() const
#define ROS_ERROR_STREAM(args)
bool executionCallback(choreo_msgs::TrajectoryExecution::Request &req, choreo_msgs::TrajectoryExecution::Response &res)
static const std::string THIS_SERVICE_NAME