-
Notifications
You must be signed in to change notification settings - Fork 26
Added joint constraint to goal regions #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
22fe8d4
59a93b1
7d648c2
a893b98
c6c7fa1
75ab34e
19ba2e6
ce6495a
0050d30
2e2a95a
2bdb6f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ core | |
|
|
||
| # Compile Commands | ||
| *compile_commands.json | ||
| .cache/ | ||
|
|
||
| # Python | ||
| __pycache__ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -178,13 +178,31 @@ namespace robowflex | |
| const GeometryConstPtr &geometry, const Eigen::Quaterniond &orientation, | ||
| const Eigen::Vector3d &tolerances); | ||
|
|
||
| /** \brief Tiles some \a geometry around a \a pose in \a base_name for the end-effector \a ee_name. | ||
| * The \a geometry is placed at \a offset from \a pose, and \a n copies are placed evenly rotated | ||
| * about \a axis. The desired \a orientation is also rotated about the axis and set for each copy. | ||
| * \param[in] ee_name The name of the end-effector link. | ||
| * \param[in] base_name The name of the frame of reference of \a pose and \a orientation. | ||
| * \param[in] pose The pose of the frame to be rotated about. | ||
| * \param[in] geometry The geometry describing the position constraint. | ||
| /** \brief Adds a joint constraint to a specific goal region. | ||
| * Creates a joint constraint for \a joint_name at \a position between the bounds specified by \a | ||
| * tolerances and adds it to the goal region indexed by \a goal_idx from \a orientation and XYZ Euler | ||
| * angle tolerances \a tolerances. | ||
| * \param[in] goal_idx The index of the goal region to add this joint constraint to. | ||
| * \param[in] joint_name The string name of the joint to constrain. | ||
| * \param[in] position The joint value to constrain to. | ||
| * \param[in] tolerances A 2D vector of the upper bound and lower bound from \a position. | ||
| */ | ||
| void addJointConstraintToGoal(int goal_idx, const std::string &joint_name, float position, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use std::size_t for all counting variables, and use double for all numbers.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also move the goal index to the last argument and make it optional, defaulting to 0 for ease of use. Similarly, I'd add a default value to the tolerances of +/- epsilon. |
||
| const Eigen::Vector2d &tolerances); | ||
|
|
||
| /** \brief Adds a MoveIt! joint constraint to a specific goal region. | ||
| * Adds a MoveIt! joint constraint to the goal region indexed by \a goal_idx. | ||
| * \param[in] goal_idx The index of the goal region to add this joint constraint to. | ||
| * \param[in] joint_constraint The MoveIt! joint constraint to add. | ||
| */ | ||
| void addJointConstraintToGoal(int goal_idx, moveit_msgs::JointConstraint joint_constraint); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the message be const &? |
||
|
|
||
| /** \brief Tiles some \a geometry around a \a pose in \a base_name for the end-effector \a | ||
| * ee_name. The \a geometry is placed at \a offset from \a pose, and \a n copies are placed evenly | ||
| * rotated about \a axis. The desired \a orientation is also rotated about the axis and set for | ||
| * each copy. \param[in] ee_name The name of the end-effector link. \param[in] base_name The name | ||
| * of the frame of reference of \a pose and \a orientation. \param[in] pose The pose of the frame | ||
| * to be rotated about. \param[in] geometry The geometry describing the position constraint. | ||
| * \param[in] orientation The desired orientation. | ||
| * \param[in] tolerances XYZ Euler angle tolerances about orientation. | ||
| * \param[in] offset Offset of the goal \a geometry from \a pose. | ||
|
|
@@ -196,15 +214,15 @@ namespace robowflex | |
| const Eigen::Quaterniond &orientation, const Eigen::Vector3d &tolerances, | ||
| const RobotPose &offset, const Eigen::Vector3d &axis, unsigned int n); | ||
|
|
||
| /** \brief Adds a set of regions to grasp a cylinder from the side. This function assumes the X-axis | ||
| * of the end-effector frame \a ee_name points "forward" for grasping. | ||
| * \param[in] ee_name The name of the end-effector link. | ||
| * \param[in] base_name The name of the frame of reference of \a pose. | ||
| * \param[in] pose The pose of the frame to be rotated about. | ||
| * \param[in] cylinder The cylinder to grasp. | ||
| * \param[in] distance The distance from the cylinder to place the regions. | ||
| * \param[in] depth The depth of boxes to create. | ||
| * \param[in] n The number of regions to create. | ||
| /** \brief Adds a set of regions to grasp a cylinder from the side. This function assumes the | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These diffs are from my clang formatter. I'm using the lab clang-format file, it just didn't like the long lines.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as it passes the check it's fine. |
||
| * X-axis of the end-effector frame \a ee_name points "forward" for grasping. | ||
| * \param[in] ee_name The name of the end-effector link. | ||
| * \param[in] base_name The name of the frame of reference of \a pose. | ||
| * \param[in] pose The pose of the frame to be rotated about. | ||
| * \param[in] cylinder The cylinder to grasp. | ||
| * \param[in] distance The distance from the cylinder to place the regions. | ||
| * \param[in] depth The depth of boxes to create. | ||
| * \param[in] n The number of regions to create. | ||
| */ | ||
| void addCylinderSideGrasp(const std::string &ee_name, const std::string &base_name, | ||
| const RobotPose &pose, const GeometryConstPtr &cylinder, double distance, | ||
|
|
@@ -245,8 +263,8 @@ namespace robowflex | |
| double tolerance = 0.001); | ||
|
|
||
| /** \brief Set a goal region for an end-effector \a ee_name. | ||
| * Sets the position constraint from \a geometry at a pose \a pose, and the orientation constraint | ||
| * from \a orientation and XYZ Euler angle tolerances \a tolerances. | ||
| * Sets the position constraint from \a geometry at a pose \a pose, and the orientation | ||
| * constraint from \a orientation and XYZ Euler angle tolerances \a tolerances. | ||
| * \param[in] ee_name The name of the end-effector link. | ||
| * \param[in] base_name The name of the frame of reference of \a pose and \a orientation. | ||
| * \param[in] pose The pose of \a geometry in \a base_frame. | ||
|
|
@@ -287,9 +305,9 @@ namespace robowflex | |
| \{ */ | ||
|
|
||
| /** \brief Set a pose constraint on the path. | ||
| * Sets the position constraint from \a geometry at a pose \a pose, and the orientation constraint | ||
| * from \a orientation and XYZ Euler angle tolerances \a tolerances. | ||
| * \param[in] ee_name The name of the end-effector link. | ||
| * Sets the position constraint from \a geometry at a pose \a pose, and the orientation | ||
| * constraint from \a orientation and XYZ Euler angle tolerances \a tolerances. | ||
| * \param[in] ee_name The name of the end-effector link. | ||
| * \param[in] base_name The name of the frame of reference of \a pose and \a orientation. | ||
| * \param[in] pose The pose of \a geometry in \a base_frame. | ||
| * \param[in] geometry The geometry describing the position constraint. | ||
|
|
@@ -328,9 +346,9 @@ namespace robowflex | |
|
|
||
| /** \brief Set the planning configuration to use for the motion planning request. | ||
| * Attempts to match \a requested_config with the planner configuration offered by \a planner_ | ||
| * that is the shortest configuration that contains \a requested_config as a substring. For example, | ||
| * specifying `RRTConnect` will match `RRTConnectkConfigDefault`, and specifying `RRT` will match | ||
| * `RRTkConfigDefault` and not `RRTConnectkConfigDefault`. | ||
| * that is the shortest configuration that contains \a requested_config as a substring. For | ||
| * example, specifying `RRTConnect` will match `RRTConnectkConfigDefault`, and specifying `RRT` | ||
| * will match `RRTkConfigDefault` and not `RRTConnectkConfigDefault`. | ||
| * \param[in] requested_config The planner config to find and use. | ||
| * \return True if the \a requested_config is found, false otherwise. | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| #include <moveit_msgs/BoundingVolume.h> | ||
| #include <moveit_msgs/PositionConstraint.h> | ||
| #include <moveit_msgs/OrientationConstraint.h> | ||
| #include <moveit_msgs/JointConstraint.h> | ||
|
|
||
| #include <robowflex_library/class_forward.h> | ||
| #include <robowflex_library/adapter.h> | ||
|
|
@@ -206,6 +207,15 @@ namespace robowflex | |
| Eigen::Quaterniond offsetOrientation(const Eigen::Quaterniond &orientation, | ||
| const Eigen::Vector3d &axis, double value); | ||
|
|
||
| /** \brief Get a joint constraint message. | ||
| * \param[in] joint_name The name of the constrained joint. | ||
| * \param[in] position The value in radians to constrain to. | ||
| * \param[in] tolerances A vector of upper bound and lower bound offsets from position. | ||
| * \return The joint constraint as a MoveIt message. | ||
| */ | ||
| moveit_msgs::JointConstraint getJointConstraint(const std::string &joint_name, float position, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double instead of float |
||
| const Eigen::Vector2d &tolerances); | ||
|
|
||
| /** \brief Sample a position within the given \a bounds using a uniform distribution. | ||
| * \param[in] bounds The desired mean orientation. | ||
| * \return The sampled position. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this for CCLS compilation databases