14 std::ostream &
operator<<(std::ostream &out,
const geometry_msgs::Pose &pose);
24 std::ostream &operator<<(std::ostream &out, const std::vector<T> &joint_data) {
25 for (T i : joint_data) {
47 Eigen::Quaternionf
ypr2quat(
float y,
float p,
float r);
49 void quat2ypr(tf::Quaternion &q,
double &r,
double &p,
double &y);
53 inline F
deg2rad(F deg) {
return deg * M_PI / 180.0; };
57 inline F
rad2deg(F rad) {
return rad * (180.0 / M_PI); };
70 moveit_msgs::CollisionObject &collision_obj, std::string primitive_id,
71 shape_msgs::SolidPrimitive &primitive, geometry_msgs::Pose &obj_pose,
73 const std::vector<double> &primitive_dims);
87 moveit_msgs::AttachedCollisionObject &attached_obj,
88 std::string primitive_id, shape_msgs::SolidPrimitive &primitive,
89 geometry_msgs::Pose &obj_pose,
91 const std::vector<double> &primitive_dims);
100 moveit_msgs::PlanningScene &planning_scene_msg,
101 ros::Publisher &planning_scene_diff_publisher);
110 moveit_msgs::AttachedCollisionObject &attached_obj,
111 moveit_msgs::PlanningScene &planning_scene_msg,
112 ros::Publisher &planning_scene_diff_publisher);
122 geometry_msgs::Pose &obj_pose,
123 moveit_msgs::PlanningScene &planning_scene_msg,
124 ros::Publisher &planning_scene_diff_publisher);
133 moveit_msgs::PlanningScene &planning_scene_msg,
134 ros::Publisher &planning_scene_diff_publisher);
143 moveit_msgs::PlanningScene &planning_scene_msg,
144 ros::Publisher &planning_scene_diff_publisher);
151 moveit::planning_interface::PlanningSceneInterface
152 &planning_scene_interface);
160 moveit::planning_interface::PlanningSceneInterface
161 &planning_scene_interface,
175 float z,
float yaw,
float pitch,
float roll);
189 float z,
float qx,
float qy,
float qz,
194 float z, tf::Vector3 &v);
198 float z, tf::Quaternion &q);
202 tf::StampedTransform &tf, tf::Quaternion &q);
211 void getTfFromFrames(tf::TransformListener &listener, tf::StampedTransform &tf,
212 std::string parent_frame, std::string child_frame);
229 std::vector<ros::Publisher>
240 const std::string frame_name);
249 const std::string child_frame);
265 moveit::planning_interface::MoveGroupInterface &move_group_interface,
266 double timeout,
int num_attempts, geometry_msgs::Pose &target_pose);
void removeCollisionObjectFromScene(moveit::planning_interface::PlanningSceneInterface &planning_scene_interface, std::string obj_id)
Remove some object from the scene.
Definition: shadow_utils.cpp:266
void createCollisionObjectFromPrimitive(moveit_msgs::CollisionObject &collision_obj, std::string primitive_id, shape_msgs::SolidPrimitive &primitive, geometry_msgs::Pose &obj_pose, shadow_utils::SHAPE_PRIMITIVES primitive_type, const std::vector< double > &primitive_dims)
Create collision object for the planning scene, used by MoveIt planning.
Definition: shadow_utils.cpp:93
std::string getControllerTopic(std::string &joint_name)
Get the name of the controller responsible for controlling the given joint name.
Definition: shadow_utils.cpp:292
std::vector< ros::Publisher > createJointControllerPublishers(std::vector< std::string > &joint_names, ros::NodeHandle &n)
Create a vector of publishers for each given joint name, using the ROS node handle.
Definition: shadow_utils.cpp:320
void detachObjectFromRobot(moveit_msgs::AttachedCollisionObject &attached_obj, moveit_msgs::PlanningScene &planning_scene_msg, ros::Publisher &planning_scene_diff_publisher)
Detach an attached collision object from the robot.
Definition: shadow_utils.cpp:236
void broadcastTransformForGrasp(std::vector< double > xyzrpy, const std::string frame_name)
Broadcasts a transform from the wrist to given frame, which can be used for planning targets for fing...
Definition: shadow_utils.cpp:365
void createAttachedObjectFromPrimitive(moveit_msgs::AttachedCollisionObject &attached_obj, std::string primitive_id, shape_msgs::SolidPrimitive &primitive, geometry_msgs::Pose &obj_pose, shadow_utils::SHAPE_PRIMITIVES primitive_type, const std::vector< double > &primitive_dims)
Create attached object for the planning scene, used by MoveIt planning when attaching object to robot...
Definition: shadow_utils.cpp:135
void quat2ypr(tf::Quaternion &q, double &r, double &p, double &y)
Conversion from Quaternion to YPR.
Definition: shadow_utils.cpp:23
SHAPE_PRIMITIVES
Primitive shapes used for RViz objects.
Definition: shadow_utils.hpp:44
moveit_msgs::RobotState computeJointsFromPose(moveit::planning_interface::MoveGroupInterface &move_group_interface, double timeout, int num_attempts, geometry_msgs::Pose &target_pose)
Creates a RobotState using the inverse kinematics solver, given a target pose. Uses a service call to...
Definition: shadow_utils.cpp:393
void getTfFromFrames(tf::TransformListener &listener, tf::StampedTransform &tf, std::string parent_frame, std::string child_frame)
Get TF from parent and child frames.
Definition: shadow_utils.cpp:276
void getPoseFromPositionQuaternion(geometry_msgs::Pose &pose, float x, float y, float z, float qx, float qy, float qz, float qw)
Generate ROS Pose from position and quaternion.
Definition: shadow_utils.cpp:29
void startTrajectoryController(ros::NodeHandle n, std::string controller_name)
Starts trajectory controller for arm or hand, using ControllerManager service call.
Definition: shadow_utils.cpp:438
F deg2rad(F deg)
Conversion from degree to radians.
Definition: shadow_utils.hpp:53
std::ostream & operator<<(std::ostream &out, const geometry_msgs::Pose &pose)
Print ROS Pose messages.
Definition: shadow_utils.cpp:7
Contains various utility functions for RViz visualization, conversions, transformations and robot con...
Definition: shadow_utils.hpp:31
void getPoseFromPositionYPR(geometry_msgs::Pose &pose, float x, float y, float z, float yaw, float pitch, float roll)
Generate ROS Pose from position and YPR.
Definition: shadow_utils.cpp:66
F rad2deg(F rad)
Conversion from radians to degrees.
Definition: shadow_utils.hpp:57
void moveCollisionObjectInScene(moveit_msgs::CollisionObject &collision_obj, geometry_msgs::Pose &obj_pose, moveit_msgs::PlanningScene &planning_scene_msg, ros::Publisher &planning_scene_diff_publisher)
Move an existing collision object in the planning scene.
Definition: shadow_utils.cpp:199
void removeAllObjectsFromScene(moveit::planning_interface::PlanningSceneInterface &planning_scene_interface)
Remove all objects from the scene.
Definition: shadow_utils.cpp:257
void attachObjectToRobot(moveit_msgs::AttachedCollisionObject &attached_obj, moveit_msgs::PlanningScene &planning_scene_msg, ros::Publisher &planning_scene_diff_publisher)
Attach a collision object to the robot.
Definition: shadow_utils.cpp:215
Eigen::Quaternionf ypr2quat(float y, float p, float r)
Conversion from YPR to Quaternion.
Definition: shadow_utils.cpp:16
void stopTrajectoryController(ros::NodeHandle n, std::string controller_name)
Stops trajectory controller for arm or hand, using ControllerManager service call.
Definition: shadow_utils.cpp:457
geometry_msgs::Pose getPoseBetweenFrames(const std::string parent_frame, const std::string child_frame)
Get the pose between two frames.
Definition: shadow_utils.cpp:340
void addCollisionObjectToScene(moveit_msgs::CollisionObject &collision_obj, moveit_msgs::PlanningScene &planning_scene_msg, ros::Publisher &planning_scene_diff_publisher)
Add a collision object to the planning scene.
Definition: shadow_utils.cpp:171
void addAttachedObjectToScene(moveit_msgs::AttachedCollisionObject &attached_obj, moveit_msgs::PlanningScene &planning_scene_msg, ros::Publisher &planning_scene_diff_publisher)
Add a collision object to the planning scene.
Definition: shadow_utils.cpp:185