Aikido
|
This class sends trajectory commands to ROS server. More...
#include <aikido/control/ros/RosTrajectoryExecutor.hpp>
Public Member Functions | |
RosTrajectoryExecutor (::ros::NodeHandle node, const std::string &serverName, double waypointTimestep, double goalTimeTolerance, const std::chrono::milliseconds &connectionTimeout=std::chrono::milliseconds{1000}, const std::chrono::milliseconds &connectionPollingPeriod=std::chrono::milliseconds{20}) | |
Constructor. More... | |
virtual | ~RosTrajectoryExecutor () |
void | validate (const trajectory::Trajectory *traj) override |
Validate the traj in preparation for execution. More... | |
std::future< void > | execute (const trajectory::ConstTrajectoryPtr &traj) override |
Sends trajectory to ROS server for execution. More... | |
std::future< void > | execute (const trajectory::ConstTrajectoryPtr &traj, const ::ros::Time &startTime) |
Sends trajectory to ROS server for execution. More... | |
void | step (const std::chrono::system_clock::time_point &timepoint) override |
Step to a point in time. More... | |
void | cancel () override |
Cancel the current trajectory. More... | |
![]() | |
virtual | ~TrajectoryExecutor ()=default |
Private Types | |
using | TrajectoryActionClient = actionlib::ActionClient< control_msgs::FollowJointTrajectoryAction > |
using | GoalHandle = TrajectoryActionClient::GoalHandle |
Private Member Functions | |
void | transitionCallback (GoalHandle handle) |
Private Attributes | |
::ros::NodeHandle | mNode |
::ros::CallbackQueue | mCallbackQueue |
TrajectoryActionClient | mClient |
TrajectoryActionClient::GoalHandle | mGoalHandle |
double | mWaypointTimestep |
double | mGoalTimeTolerance |
std::chrono::milliseconds | mConnectionTimeout |
std::chrono::milliseconds | mConnectionPollingPeriod |
bool | mInProgress |
std::unique_ptr< std::promise< void > > | mPromise |
std::mutex | mMutex |
Manages access to mInProgress, mPromise. More... | |
Additional Inherited Members | |
![]() | |
std::set< const trajectory::Trajectory * > | mValidatedTrajectories |
Set of trajectories validated by executor. More... | |
std::chrono::system_clock::time_point | mExecutionStartTime |
Time of previous call. More... | |
This class sends trajectory commands to ROS server.
|
private |
|
private |
aikido::control::ros::RosTrajectoryExecutor::RosTrajectoryExecutor | ( | ::ros::NodeHandle | node, |
const std::string & | serverName, | ||
double | waypointTimestep, | ||
double | goalTimeTolerance, | ||
const std::chrono::milliseconds & | connectionTimeout = std::chrono::milliseconds{1000} , |
||
const std::chrono::milliseconds & | connectionPollingPeriod = std::chrono::milliseconds{20} |
||
) |
Constructor.
[in] | node | ROS node handle for action client. |
[in] | serverName | Name of the server to send trajectory to. |
[in] | waypointTimestep | Step size for interpolating trajectories. |
[in] | goalTimeTolerance | |
[in] | connectionTimeout | Timeout for server connection. |
[in] | connectionPollingPeriod | Polling period for server connection. |
|
virtual |
|
overridevirtual |
Cancel the current trajectory.
Implements aikido::control::TrajectoryExecutor.
|
overridevirtual |
Sends trajectory to ROS server for execution.
[in] | traj | Trajectory to be executed. |
Implements aikido::control::TrajectoryExecutor.
std::future<void> aikido::control::ros::RosTrajectoryExecutor::execute | ( | const trajectory::ConstTrajectoryPtr & | traj, |
const ::ros::Time & | startTime | ||
) |
Sends trajectory to ROS server for execution.
[in] | traj | Trajectory to be executed. |
[in] | startTime | Start time for the trajectory. |
|
overridevirtual |
Step to a point in time.
timepoint
can be a time in the future to enable faster than real-time execution.timepoint | Time to simulate to |
To be executed on a separate thread. Regularly checks for the completion of a sent trajectory.
Implements aikido::control::TrajectoryExecutor.
|
private |
|
overridevirtual |
Validate the traj in preparation for execution.
traj | Trajectory to be validated |
Implements aikido::control::TrajectoryExecutor.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
Manages access to mInProgress, mPromise.
|
private |
|
private |
|
private |