Skip to content
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

Adds orientation constraints #55

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
234 changes: 117 additions & 117 deletions demo/src/constrained_planning_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ int main(int argc, char** argv)

// Now wait for the user to press Next before trying the planar constraints.
moveit_visual_tools.prompt(
"Press 'Next' in the RvizVisualToolsGui window to continue to the planar constraint example");
"Press 'Next' in the RvizVisualToolsGui window to continue to the orientation constraint example");

// Clear the path constraints and markers for the next example
reset_demo();
/*reset_demo();*/

// In the second problem we plan with the end-effector constrained to a plane.
// We need to create a pose goal that lies in this plane.
// The plane is tilted by 45 degrees, so moving an equal amount in the y and z direction should be ok.
// Any goal or start state should also satisfy the path constraints.
target_pose = get_relative_pose(0.0, 0.3, -0.3);
/*target_pose = get_relative_pose(0.0, 0.3, -0.3);*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just talked to Aditya and I think we should keep and uncomment as these are the move-on-line and move-within-plane demos

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I do suspect that the rotated bounding box constraints may not work with the current implementation of position constraints -- there is another overload that accepts a rigid transform from a coordinate frame A to A_bar which enables rotating the reference frame, and we may need to achieve this.

Trying it out will tell.


// We create a plane perpendicular to the y-axis and tilt it by 45 degrees

Expand All @@ -122,88 +122,88 @@ int main(int argc, char** argv)
// (:code:`1e-4` by default). MoveIt will use the stricter tolerance (the box width) to check the constraints, and
// many states will appear invalid. That's where the magic number :code:`0.0005` comes from, it is between
// :code:`0.00001` and :code:`0.001`.
moveit_msgs::msg::PositionConstraint plane_constraint;
plane_constraint.header.frame_id = move_group_interface.getPoseReferenceFrame();
plane_constraint.link_name = move_group_interface.getEndEffectorLink();
shape_msgs::msg::SolidPrimitive plane;
plane.type = shape_msgs::msg::SolidPrimitive::BOX;
plane.dimensions = { 1.0, 0.0005, 1.0 };
plane_constraint.constraint_region.primitives.emplace_back(plane);

geometry_msgs::msg::Pose plane_pose;
plane_pose.position.x = current_pose.pose.position.x;
plane_pose.position.y = current_pose.pose.position.y;
plane_pose.position.z = current_pose.pose.position.z;
plane_pose.orientation.x = sin(M_PI_4 / 2);
plane_pose.orientation.y = 0.0;
plane_pose.orientation.z = 0.0;
plane_pose.orientation.w = cos(M_PI_4 / 2);
plane_constraint.constraint_region.primitive_poses.emplace_back(plane_pose);
plane_constraint.weight = 1.0;

// Visualize the constraint
auto d = sqrt(pow(target_pose.pose.position.y, 2) + pow(target_pose.pose.position.z, 2));

Eigen::Vector3d normal(0, 1, 1);
moveit_visual_tools.publishNormalAndDistancePlane(normal, d, rviz_visual_tools::TRANSLUCENT_DARK);
moveit_visual_tools.trigger();

moveit_msgs::msg::Constraints plane_constraints;
plane_constraints.position_constraints.emplace_back(plane_constraint);
plane_constraints.name = "use_equality_constraints";
move_group_interface.setPathConstraints(plane_constraints);

// And again, configure and solve the planning problem
move_group_interface.setPoseTarget(target_pose);
move_group_interface.setPlanningTime(10.0);

success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);
RCLCPP_INFO(LOGGER, "Plan with plane constraint %s", success ? "" : "FAILED");

moveit_visual_tools.prompt(
"Press 'next' in the RvizVisualToolsGui window to continue to the linear constraint example");

reset_demo();

// We can also plan along a line. We can use the same pose as last time.
target_pose = get_relative_pose(0.0, 0.3, -0.3);

// Building on the previous constraint, we can make it a line, by also reducing the dimension of the box in the x-direction.
moveit_msgs::msg::PositionConstraint line_constraint;
line_constraint.header.frame_id = move_group_interface.getPoseReferenceFrame();
line_constraint.link_name = move_group_interface.getEndEffectorLink();
shape_msgs::msg::SolidPrimitive line;
line.type = shape_msgs::msg::SolidPrimitive::BOX;
line.dimensions = { 0.0005, 0.0005, 1.0 };
line_constraint.constraint_region.primitives.emplace_back(line);

geometry_msgs::msg::Pose line_pose;
line_pose.position.x = current_pose.pose.position.x;
line_pose.position.y = current_pose.pose.position.y;
line_pose.position.z = current_pose.pose.position.z;
line_pose.orientation.x = sin(M_PI_4 / 2);
line_pose.orientation.y = 0.0;
line_pose.orientation.z = 0.0;
line_pose.orientation.w = cos(M_PI_4 / 2);
line_constraint.constraint_region.primitive_poses.emplace_back(line_pose);
line_constraint.weight = 1.0;

// Visualize the constraint
moveit_visual_tools.publishLine(current_pose.pose.position, target_pose.pose.position,
rviz_visual_tools::TRANSLUCENT_DARK);
moveit_visual_tools.trigger();

moveit_msgs::msg::Constraints line_constraints;
line_constraints.position_constraints.emplace_back(line_constraint);
line_constraints.name = "use_equality_constraints";
move_group_interface.setPathConstraints(line_constraints);
move_group_interface.setPoseTarget(target_pose);

success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);
RCLCPP_INFO(LOGGER, "Plan with line constraint %s", success ? "" : "FAILED");

moveit_visual_tools.prompt(
"Press 'Next' in the RvizVisualToolsGui window to continue to the orientation constraint example");
/*moveit_msgs::msg::PositionConstraint plane_constraint;*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove whatever is commented out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

/*plane_constraint.header.frame_id = move_group_interface.getPoseReferenceFrame();*/
/*plane_constraint.link_name = move_group_interface.getEndEffectorLink();*/
/*shape_msgs::msg::SolidPrimitive plane;*/
/*plane.type = shape_msgs::msg::SolidPrimitive::BOX;*/
/*plane.dimensions = { 1.0, 0.0005, 1.0 };*/
/*plane_constraint.constraint_region.primitives.emplace_back(plane);*/
/**/
/*geometry_msgs::msg::Pose plane_pose;*/
/*plane_pose.position.x = current_pose.pose.position.x;*/
/*plane_pose.position.y = current_pose.pose.position.y;*/
/*plane_pose.position.z = current_pose.pose.position.z;*/
/*plane_pose.orientation.x = sin(M_PI_4 / 2);*/
/*plane_pose.orientation.y = 0.0;*/
/*plane_pose.orientation.z = 0.0;*/
/*plane_pose.orientation.w = cos(M_PI_4 / 2);*/
/*plane_constraint.constraint_region.primitive_poses.emplace_back(plane_pose);*/
/*plane_constraint.weight = 1.0;*/
/**/
/*// Visualize the constraint*/
/*auto d = sqrt(pow(target_pose.pose.position.y, 2) + pow(target_pose.pose.position.z, 2));*/
/**/
/*Eigen::Vector3d normal(0, 1, 1);*/
/*moveit_visual_tools.publishNormalAndDistancePlane(normal, d, rviz_visual_tools::TRANSLUCENT_DARK);*/
/*moveit_visual_tools.trigger();*/
/**/
/*moveit_msgs::msg::Constraints plane_constraints;*/
/*plane_constraints.position_constraints.emplace_back(plane_constraint);*/
/*plane_constraints.name = "use_equality_constraints";*/
/*move_group_interface.setPathConstraints(plane_constraints);*/
/**/
/*// And again, configure and solve the planning problem*/
/*move_group_interface.setPoseTarget(target_pose);*/
/*move_group_interface.setPlanningTime(10.0);*/
/**/
/*success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);*/
/*RCLCPP_INFO(LOGGER, "Plan with plane constraint %s", success ? "" : "FAILED");*/
/**/
/*moveit_visual_tools.prompt(*/
/* "Press 'next' in the RvizVisualToolsGui window to continue to the linear constraint example");*/
/**/
/*reset_demo();*/
/**/
/*// We can also plan along a line. We can use the same pose as last time.*/
/*target_pose = get_relative_pose(0.0, 0.3, -0.3);*/
/**/
/*// Building on the previous constraint, we can make it a line, by also reducing the dimension of the box in the x-direction.*/
/*moveit_msgs::msg::PositionConstraint line_constraint;*/
/*line_constraint.header.frame_id = move_group_interface.getPoseReferenceFrame();*/
/*line_constraint.link_name = move_group_interface.getEndEffectorLink();*/
/*shape_msgs::msg::SolidPrimitive line;*/
/*line.type = shape_msgs::msg::SolidPrimitive::BOX;*/
/*line.dimensions = { 0.0005, 0.0005, 1.0 };*/
/*line_constraint.constraint_region.primitives.emplace_back(line);*/
/**/
/*geometry_msgs::msg::Pose line_pose;*/
/*line_pose.position.x = current_pose.pose.position.x;*/
/*line_pose.position.y = current_pose.pose.position.y;*/
/*line_pose.position.z = current_pose.pose.position.z;*/
/*line_pose.orientation.x = sin(M_PI_4 / 2);*/
/*line_pose.orientation.y = 0.0;*/
/*line_pose.orientation.z = 0.0;*/
/*line_pose.orientation.w = cos(M_PI_4 / 2);*/
/*line_constraint.constraint_region.primitive_poses.emplace_back(line_pose);*/
/*line_constraint.weight = 1.0;*/
/**/
/*// Visualize the constraint*/
/*moveit_visual_tools.publishLine(current_pose.pose.position, target_pose.pose.position,*/
/* rviz_visual_tools::TRANSLUCENT_DARK);*/
/*moveit_visual_tools.trigger();*/
/**/
/*moveit_msgs::msg::Constraints line_constraints;*/
/*line_constraints.position_constraints.emplace_back(line_constraint);*/
/*line_constraints.name = "use_equality_constraints";*/
/*move_group_interface.setPathConstraints(line_constraints);*/
/*move_group_interface.setPoseTarget(target_pose);*/
/**/
/*success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);*/
/*RCLCPP_INFO(LOGGER, "Plan with line constraint %s", success ? "" : "FAILED");*/
/**/
/*moveit_visual_tools.prompt(*/
/* "Press 'Next' in the RvizVisualToolsGui window to continue to the orientation constraint example");*/
reset_demo();

// Finally, we can place constraints on orientation.
Expand All @@ -229,42 +229,42 @@ int main(int argc, char** argv)
success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);
RCLCPP_INFO(LOGGER, "Plan with orientation constraint %s", success ? "" : "FAILED");

moveit_visual_tools.prompt("Press 'Next' in the RvizVisualToolsGui window to try mixed_constraints");
/*moveit_visual_tools.prompt("Press 'Next' in the RvizVisualToolsGui window to try mixed_constraints");*/
reset_demo();

// Finally, we can place constraints on orientation.
// Use the target pose from the previous example
target_pose = get_relative_pose(-0.6, 0.1, 0);

// Reuse the orientation constraint, and make a new box constraint
box.dimensions = { 1.0, 0.6, 1.0 };
box_constraint.constraint_region.primitives[0] = box;

box_pose.position.x = 0;
box_pose.position.y = -0.1;
box_pose.position.z = current_pose.pose.position.z;
box_constraint.constraint_region.primitive_poses[0] = box_pose;
box_constraint.weight = 1.0;

// Visualize the box constraint
Eigen::Vector3d new_box_point_1(box_pose.position.x - box.dimensions[0] / 2,
box_pose.position.y - box.dimensions[1] / 2,
box_pose.position.z - box.dimensions[2] / 2);
Eigen::Vector3d new_box_point_2(box_pose.position.x + box.dimensions[0] / 2,
box_pose.position.y + box.dimensions[1] / 2,
box_pose.position.z + box.dimensions[2] / 2);
moveit_msgs::msg::Constraints mixed_constraints;
mixed_constraints.position_constraints.emplace_back(box_constraint);
mixed_constraints.orientation_constraints.emplace_back(orientation_constraint);
moveit_visual_tools.publishCuboid(new_box_point_1, new_box_point_2, rviz_visual_tools::TRANSLUCENT_DARK);
moveit_visual_tools.trigger();

move_group_interface.setPathConstraints(mixed_constraints);
move_group_interface.setPoseTarget(target_pose);
move_group_interface.setPlanningTime(20.0);

success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);
RCLCPP_INFO(LOGGER, "Plan with mixed constraint %s", success ? "" : "FAILED");
/*target_pose = get_relative_pose(-0.6, 0.1, 0);*/
/**/
/*// Reuse the orientation constraint, and make a new box constraint*/
/*box.dimensions = { 1.0, 0.6, 1.0 };*/
/*box_constraint.constraint_region.primitives[0] = box;*/
/**/
/*box_pose.position.x = 0;*/
/*box_pose.position.y = -0.1;*/
/*box_pose.position.z = current_pose.pose.position.z;*/
/*box_constraint.constraint_region.primitive_poses[0] = box_pose;*/
/*box_constraint.weight = 1.0;*/
/**/
/*// Visualize the box constraint*/
/*Eigen::Vector3d new_box_point_1(box_pose.position.x - box.dimensions[0] / 2,*/
/* box_pose.position.y - box.dimensions[1] / 2,*/
/* box_pose.position.z - box.dimensions[2] / 2);*/
/*Eigen::Vector3d new_box_point_2(box_pose.position.x + box.dimensions[0] / 2,*/
/* box_pose.position.y + box.dimensions[1] / 2,*/
/* box_pose.position.z + box.dimensions[2] / 2);*/
/*moveit_msgs::msg::Constraints mixed_constraints;*/
/*mixed_constraints.position_constraints.emplace_back(box_constraint);*/
/*mixed_constraints.orientation_constraints.emplace_back(orientation_constraint);*/
/*moveit_visual_tools.publishCuboid(new_box_point_1, new_box_point_2, rviz_visual_tools::TRANSLUCENT_DARK);*/
/*moveit_visual_tools.trigger();*/
/**/
/*move_group_interface.setPathConstraints(mixed_constraints);*/
/*move_group_interface.setPoseTarget(target_pose);*/
/*move_group_interface.setPlanningTime(20.0);*/
/**/
/*success = (move_group_interface.plan(plan) == moveit::core::MoveItErrorCode::SUCCESS);*/
/*RCLCPP_INFO(LOGGER, "Plan with mixed constraint %s", success ? "" : "FAILED");*/

// Done!
moveit_visual_tools.prompt("Press 'Next' in the RvizVisualToolsGui window to clear the markers");
Expand Down
5 changes: 5 additions & 0 deletions include/ktopt_interface/ktopt_planning_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "drake/visualization/visualization_config_functions.h"
#include <drake/multibody/inverse_kinematics/minimum_distance_lower_bound_constraint.h>
#include <drake/multibody/inverse_kinematics/position_constraint.h>
#include <drake/multibody/inverse_kinematics/orientation_constraint.h>

namespace ktopt_interface
{
Expand All @@ -49,10 +50,12 @@ using drake::geometry::Shape;
using drake::geometry::SourceId;
using drake::geometry::Sphere;
using drake::math::RigidTransformd;
using drake::math::RotationMatrixd;
using drake::multibody::AddMultibodyPlantSceneGraph;
using drake::multibody::Frame;
using drake::multibody::MinimumDistanceLowerBoundConstraint;
using drake::multibody::MultibodyPlant;
using drake::multibody::OrientationConstraint;
using drake::multibody::PackageMap;
using drake::multibody::Parser;
using drake::multibody::PositionConstraint;
Expand Down Expand Up @@ -84,6 +87,8 @@ class KTOptPlanningContext : public planning_interface::PlanningContext
void transcribePlanningScene(const planning_scene::PlanningScene& planning_scene);
void addPathPositionConstraints(KinematicTrajectoryOptimization& trajopt, const MultibodyPlant<double>& plant,
Context<double>& plant_context, const double padding);
void addPathOrientationConstraints(KinematicTrajectoryOptimization& trajopt, const MultibodyPlant<double>& plant,
Context<double>& plant_context, const double padding);

private:
const ktopt_interface::Params params_;
Expand Down
68 changes: 68 additions & 0 deletions src/ktopt_planning_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ void KTOptPlanningContext::solve(planning_interface::MotionPlanResponse& res)

// process path_constraints
addPathPositionConstraints(trajopt, plant, plant_context, params_.position_constraint_padding);
addPathOrientationConstraints(trajopt, plant, plant_context, params_.orientation_constraint_padding);

// solve the program
auto result = Solve(prog);
Expand Down Expand Up @@ -252,6 +253,73 @@ void KTOptPlanningContext::addPathPositionConstraints(KinematicTrajectoryOptimiz
}
}

void KTOptPlanningContext::addPathOrientationConstraints(KinematicTrajectoryOptimization& trajopt,
const MultibodyPlant<double>& plant,
Context<double>& plant_context, const double padding)
{
// retrieve the motion planning request
const auto& req = getMotionPlanRequest();

// check for path position constraints
if (!req.path_constraints.orientation_constraints.empty())
{
for (const auto& orientation_constraint : req.path_constraints.orientation_constraints)
{
// NOTE: Current thesis, when you apply a Drake Orientation Constraint it
// expects the following
// Frame A: The frame in which the orientation constraint is defined
// Frame B: The frame to which the orientation constraint is enforced

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the code below, the roles of A and B are exactly swapped: orientation_constraint.link_name defines the frame which is enforced and orientation_constraint.header.frame_id is the defining frame.

Copy link
Member Author

@kamiradi kamiradi Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh nice catch. Thanks for that! However, I was adding it correctly into the constraints. I'll update the comments

// theta_bound: The angle difference between frame A's orientation and
// frame B's orientation

// Extract FrameA and FrameB for orientation constraint
// frame A
const auto link_ee_name = orientation_constraint.link_name;
if (!plant.HasBodyNamed(link_ee_name))
{
RCLCPP_ERROR(getLogger(),
"The link specified in the PositionConstraint message, %s, does not exist in the Drake "
sea-bass marked this conversation as resolved.
Show resolved Hide resolved
"plant.",
link_ee_name.c_str());
continue;
}
const auto& link_ee_frame = plant.GetFrameByName(link_ee_name);

// frame B
const auto base_frame_name = orientation_constraint.header.frame_id;
if (!plant.HasBodyNamed(base_frame_name))
{
RCLCPP_ERROR(getLogger(),
"The link specified in the PositionConstraint message, %s, does not exist in the Drake "
sea-bass marked this conversation as resolved.
Show resolved Hide resolved
"plant.",
base_frame_name.c_str());
continue;
}
const auto& base_frame = plant.GetFrameByName(base_frame_name);

// Extract the orientation of that Frame B needs to be constrained to w.r.t Frame A
const auto& constrained_orientation = orientation_constraint.orientation;
// convert to drake's RotationMatrix
const auto R_BbarB = RotationMatrixd(Eigen::Quaterniond(constrained_orientation.w, constrained_orientation.x,
constrained_orientation.y, constrained_orientation.z));

// NOTE: There are 3 tolerances given for the orientation constraint in moveit
// message, rake only takes in a single theta bound. For now, we take any
sea-bass marked this conversation as resolved.
Show resolved Hide resolved
// of the tolerances as the theta bound
const double theta_bound = orientation_constraint.absolute_x_axis_tolerance;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theta_bound is not used!?

Copy link
Contributor

@sea-bass sea-bass Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think theta_bound and padding need to be combined in some way in the constructor of OrientationConstraint below, whereas only padding is currently used at the moment. That seems incorrect.

Probably just theta_bound - padding, or theta_bound - 2.0 * padding depending on how we want to enforce it? (plus some max to make sure the bound does not go below zero)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, since theta_bound uses the whole angle (per the documentation), does it make sense to do something like take the norm of the X/Y/Z angle tolerances?

This is still not a proper calculation, so I think we anyhow have to be "creative" in how we interpret the tolerances in the MoveIt message vs. what translates to here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is but only via the orientation padding parameter in the yaml file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the variable theta_bound needs to be used in the actual OrientationConstraint creation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with #55 (comment) to use the norm or sum of all angle tolerances. MoveIt's orientation constraint is much more flexible than Drake's one, allowing deviations to be specified for all rotation axes separately. It will only translate in a meaningful way if the MoveIt tolerances are all identical.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So for this, a better approach would be to add an additional rotational transformation to R_BbarB, computing R_BbarBx, R_BbarBy and R_BbarBz - add 3 different orientation constraints for each axis with the theta_bounds being the individual tolerances.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work. Drake's orientation constraint already fully constrains all three axes. Adding more orientation constraints doesn't make sense.


// Add position constraint to each knot point of the trajectory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering in the last PR whether we should have used the same number of knot points for all position/orientation constraints. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a parameter, so the user has the option of adding more/less constraints along the path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I meant should there be 2 separate parameters for position/orientation constraints, or just use the same parameter for all constraints?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I meant, right now even though im reading theta bound as the tolerance, I am using the one @sea-bass added as a parameter.

for (int i = 0; i < params_.num_orientation_constraint_points; ++i)
{
trajopt.AddPathPositionConstraint(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PositionConstraint?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strangely enough, this is correct...
https://stackoverflow.com/q/79041210

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the terminology reflects that it is indeed still a constraint on the generalized positions, which happens to be a vector in the configuration space. Therefore, you are adding a constraint on one coordinate (link end-effector) out of all the available coordinates. At least this is my understanding

std::make_shared<OrientationConstraint>(&plant, base_frame, RotationMatrixd::Identity(), link_ee_frame,
R_BbarB, padding, &plant_context),
static_cast<double>(i) / (params_.num_position_constraint_points - 1));
}
}
}
}

bool KTOptPlanningContext::terminate()
{
RCLCPP_ERROR(getLogger(), "KTOptPlanningContext::terminate() is not implemented!");
Expand Down
Loading