Robowflex  v0.1
Making MoveIt Easy
conversions.h
Go to the documentation of this file.
1 /* Author: Carlos Quintero, Bryce Willey */
2 
3 #ifndef ROBOWFLEX_TESSERACT_CONVERSIONS_
4 #define ROBOWFLEX_TESSERACT_CONVERSIONS_
5 
9 #include <tesseract_ros/kdl/kdl_env.h>
10 
11 namespace robowflex
12 {
13  /** \cond IGNORE */
16  /** \endcond */
17 
18  namespace hypercube
19  {
20  /** \brief Add scene collision objects to a (previously initialized) KDL environment.
21  * \param[in] scene Scene to load.
22  * \param[out] env KDL environment to add scene objects to.
23  * \return True if the KDL environment was correctly loaded from scene.
24  */
26  tesseract::tesseract_ros::KDLEnvPtr env);
27 
28  /** \brief Add bodies attached to the robot scratch state to the KDL environment.
29  * \param[in] state Robot state with objects attached.
30  * \param[out] env KDL environment to add the attached objects.
31  * \return True if the KDL environment was correctly updated.
32  */
33  bool addAttachedBodiesToTesseractEnv(const robot_state::RobotStatePtr &state,
34  tesseract::tesseract_ros::KDLEnvPtr env);
35 
36  /** \brief Transform a \a robot_state to a vector representing joint values for the manipulator (in
37  * the order given by \a manip_joint_names).
38  * \param[in] robot_state Robot state to be transformed.
39  * \param[in] manip_joint_names Joint names for the manipulator state.
40  * \param[out] manip_joint_values Manipulator's joint values representing \a robot_state.
41  */
42  void robotStateToManipState(const robot_state::RobotStatePtr &robot_state,
43  const std::vector<std::string> &manip_joint_names,
44  std::vector<double> &manip_joint_values);
45 
46  /** \brief Transform a tesseract \a waypoint (manip state) to robot \a state. Joint values for
47  * non-manip joints are taken from \a env.
48  * \param[in] manip_state Tesseract manipulator state to be transformed.
49  * \param[in] manip Name of manipulator.
50  * \param[in] env KDL environment with the robot (and manipulator) information already loaded.
51  * \param[out] robot_state Robot state representing \a manip_state.
52  */
53  void manipStateToRobotState(const Eigen::Ref<const Eigen::VectorXd> &manip_state,
54  const std::string &manip, const tesseract::tesseract_ros::KDLEnvPtr &env,
55  robot_state::RobotStatePtr robot_state);
56 
57  /** \brief Transform a tesseract trajectory to a robot \a trajectory.
58  * \param[in] tesseract_traj Tesseract trajectory to transform.
59  * \param[in] robot Robot \a tesseract_traj belongs to.
60  * \param[in] manip Name of manipulator.
61  * \param[in] env KDL environment with the robot (and manipulator) information already loaded.
62  * \param[out] trajectory Robot trajectory corresponding to \a tesseract_traj.
63  */
64  void manipTesseractTrajToRobotTraj(const tesseract::TrajArray &tesseract_traj,
65  const robot_state::RobotStatePtr &ref_state,
66  const std::string &manip,
67  const tesseract::tesseract_ros::KDLEnvPtr &env,
68  robot_trajectory::RobotTrajectoryPtr trajectory);
69 
70  /** \brief Transform a \a robot_trajectory to a tesseract manipulator \a trajectory.
71  * \param[in] robot_traj Robot Trajectory to transform.
72  * \param[in] manip Name of manipulator in KDL env.
73  * \param[in] env KDL environment with the robot (and manipulator) information already loaded.
74  * \param[out] trajectory Tesseract trajectory array corresponding to \a robot_trajectory.
75  */
76  void robotTrajToManipTesseractTraj(const robot_trajectory::RobotTrajectoryPtr &robot_traj,
77  const std::string &manip,
78  const tesseract::tesseract_ros::KDLEnvPtr &env,
79  tesseract::TrajArray &trajectory);
80 
81  } // namespace hypercube
82 } // namespace robowflex
83 
84 #endif
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
Definition: class_forward.h:16
A const shared pointer wrapper for robowflex::Scene.
void manipStateToRobotState(const Eigen::Ref< const Eigen::VectorXd > &manip_state, const std::string &manip, const tesseract::tesseract_ros::KDLEnvPtr &env, robot_state::RobotStatePtr robot_state)
Transform a tesseract waypoint (manip state) to robot state. Joint values for non-manip joints are ta...
void manipTesseractTrajToRobotTraj(const tesseract::TrajArray &tesseract_traj, const robot_state::RobotStatePtr &ref_state, const std::string &manip, const tesseract::tesseract_ros::KDLEnvPtr &env, robot_trajectory::RobotTrajectoryPtr trajectory)
Transform a tesseract trajectory to a robot trajectory.
bool sceneToTesseractEnv(const robowflex::SceneConstPtr &scene, tesseract::tesseract_ros::KDLEnvPtr env)
Add scene collision objects to a (previously initialized) KDL environment.
Definition: conversions.cpp:17
bool addAttachedBodiesToTesseractEnv(const robot_state::RobotStatePtr &state, tesseract::tesseract_ros::KDLEnvPtr env)
Add bodies attached to the robot scratch state to the KDL environment.
void robotTrajToManipTesseractTraj(const robot_trajectory::RobotTrajectoryPtr &robot_traj, const std::string &manip, const tesseract::tesseract_ros::KDLEnvPtr &env, tesseract::TrajArray &trajectory)
Transform a robot_trajectory to a tesseract manipulator trajectory.
void robotStateToManipState(const robot_state::RobotStatePtr &robot_state, const std::vector< std::string > &manip_joint_names, std::vector< double > &manip_joint_values)
Transform a robot_state to a vector representing joint values for the manipulator (in the order given...
Main namespace. Contains all library classes and functions.
Definition: scene.cpp:25
Functions for loading and animating scenes in Blender.
robot_trajectory::RobotTrajectory trajectory(rmodel,"right_arm")