Skip to content

Commit a24729d

Browse files
authored
Make base frame a parameter (#63)
1 parent 154e32b commit a24729d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: parameters/ktopt_moveit_parameters.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ ktopt_interface:
44
description: "Robot description to be loaded by the internal Drake MultibodyPlant.",
55
default_value: "package://drake_models/franka_description/urdf/panda_arm_hand.urdf",
66
}
7+
base_frame: {
8+
type: string,
9+
description: "Base frame of the robot that is attached to whatever the robot is mounted on.",
10+
default_value: "panda_link0",
11+
}
712
num_iterations: {
813
type: int,
914
description: "Number of iterations for the Drake mathematical program solver.",

Diff for: src/ktopt_planning_context.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ void KTOptPlanningContext::solve(planning_interface::MotionPlanResponse& res)
161161
// add collision constraints
162162
for (int s = 0; s < params_.num_collision_check_points; ++s)
163163
{
164+
// The constraint will be evaluated as if it is bound with variables corresponding to r(s).
164165
trajopt.AddPathPositionConstraint(std::make_shared<drake::multibody::MinimumDistanceLowerBoundConstraint>(
165166
&plant, params_.collision_check_lower_distance_bound, &plant_context),
166167
static_cast<double>(s) / (params_.num_collision_check_points - 1));
@@ -375,7 +376,7 @@ void KTOptPlanningContext::setRobotDescription(const std::string& robot_descript
375376
const char* ModelUrl = params_.drake_robot_description.c_str();
376377
const std::string urdf = drake::multibody::PackageMap{}.ResolveUrl(ModelUrl);
377378
auto robot_instance = drake::multibody::Parser(&plant, &scene_graph).AddModels(urdf);
378-
plant.WeldFrames(plant.world_frame(), plant.GetFrameByName("panda_link0"));
379+
plant.WeldFrames(plant.world_frame(), plant.GetFrameByName(params_.base_frame));
379380

380381
// planning scene transcription
381382
const auto scene = getPlanningScene();

0 commit comments

Comments
 (0)