Skip to content

Commit

Permalink
adds urdf as a param
Browse files Browse the repository at this point in the history
  • Loading branch information
kamiradi committed Sep 18, 2024
1 parent 545146d commit c873ba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions res/ktopt_moveit_parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
ktopt_interface:
drake_robot_description: {
type: string,
description: "Robot description to be loaded by the internal Drake MultibodyPlant",
default_value: "package://drake_models/franka_description/urdf/panda_arm_hand.urdf",
# validation: {
# gt_eq<>: [1]
# }
}
num_iterations: {
type: int,
description: "Number of iterations for the Drake mathematical program solver.",
Expand Down
5 changes: 3 additions & 2 deletions src/ktopt_planning_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ void KTOptPlanningContext::setRobotDescription(std::string robot_description)
// auto robot_instance = Parser(plant_, scene_graph_).AddModelsFromString(robot_description_, ".urdf");

// HACK: For now loading directly from drake's package map
const char* ModelUrl = "package://drake_models/franka_description/"
"urdf/panda_arm_hand.urdf";
// const char* ModelUrl = "package://drake_models/franka_description/"
// "urdf/panda_arm_hand.urdf";
const char* ModelUrl = params_.drake_robot_description.c_str();
const std::string urdf = PackageMap{}.ResolveUrl(ModelUrl);
auto robot_instance = Parser(&plant, &scene_graph).AddModels(urdf);
plant.WeldFrames(plant.world_frame(), plant.GetFrameByName("panda_link0"));
Expand Down

0 comments on commit c873ba5

Please sign in to comment.