3 #ifndef ROBOWFLEX_TRAJECTORY_
4 #define ROBOWFLEX_TRAJECTORY_
9 #include <moveit/robot_state/robot_state.h>
10 #include <moveit/robot_trajectory/robot_trajectory.h>
11 #include <moveit_msgs/RobotTrajectory.h>
25 std::function<double(
const robot_state::RobotState &,
const robot_state::RobotState &)>;
68 void useMessage(
const robot_state::RobotState &reference_state,
69 const moveit_msgs::RobotTrajectory &msg);
75 void useMessage(
const robot_state::RobotState &reference_state,
76 const trajectory_msgs::JointTrajectory &msg);
109 moveit_msgs::RobotTrajectory
getMessage()
const;
148 double max_velocity = 1.,
double max_acceleration = 1.);
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
A const shared pointer wrapper for robowflex::Robot.
A const shared pointer wrapper for robowflex::Scene.
The Trajectory class is a wrapper around MoveIt!'s robot_trajectory::RobotTrajectory,...
Trajectory(const RobotConstPtr &robot, const std::string &group)
Constructor for an empty trajectory.
void interpolate(unsigned int count)
Insert a number of states in a path so that the path is made up of exactly count states....
bool computeTimeParameterization(double max_velocity=1., double max_acceleration=1.)
Computes the time parameterization of a path according to a desired max velocity or acceleration.
Trajectory & append(const Trajectory &source, double dt, size_t start_index=0, size_t end_index=std::numeric_limits< std::size_t >::max())
Adds a specified part of a trajectory to the end of the current trajectory. The default,...
std::map< std::string, double > getFinalPositions() const
Returns the joint positions from the last state in a planned trajectory in response.
robot_trajectory::RobotTrajectoryPtr trajectory_
std::vector< std::vector< double > > vectorize() const
Converts a trajectory into a vector of position vectors. The values are in the same order as reported...
bool fromYAMLFile(const robot_state::RobotState &reference_state, const std::string &filename)
Load a trajectory from a YAML file.
const robot_trajectory::RobotTrajectoryPtr & getTrajectoryConst() const
Get a const reference to the trajectory.
std::vector< std::string > getJointNames() const
Get the names of the variables that make up this trajectory, in the same order as in MoveIt JointMode...
void addSuffixWaypoint(const robot_state::RobotState &state, double dt=1.)
Add a waypoint at the end of the trajectory.
bool toYAMLFile(const std::string &filename) const
Dump a trajectory to a file.
double getLength(const PathMetric &metric={}) const
Get the length of a path. Optionally, a metric can be specified other than the default (the L2 norm).
std::tuple< double, double, double > getClearance(const SceneConstPtr &scene) const
Get the average, minimum, and maximum clearance of a path.
bool isCollisionFree(const SceneConstPtr &scene) const
Checks if a path is collsion free.
robot_trajectory::RobotTrajectoryPtr & getTrajectory()
Get a reference to the trajectory.
double getSmoothness(const PathMetric &metric={}) const
Get the smoothness of a path relative to some metric. See internal function documentation for details...
void useMessage(const robot_state::RobotState &reference_state, const moveit_msgs::RobotTrajectory &msg)
Set the trajectory to be the same as a message.
moveit_msgs::RobotTrajectory getMessage() const
Get the message that describes the trajectory.
std::size_t getNumWaypoints() const
Returns the number of waypoints of the trajectory.
Functions for loading and animating robots in Blender.
Main namespace. Contains all library classes and functions.
Functions for loading and animating scenes in Blender.
robot_trajectory::RobotTrajectory trajectory(rmodel,"right_arm")