-
Notifications
You must be signed in to change notification settings - Fork 10
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
Kinematic Trajectory Optimization Skeleton PR #8
Changes from all commits
9c6e420
3cc7290
bad9ae5
4d418d5
b0bf263
5a49354
cb33b01
d2913f9
cdae97e
7761068
4698eaf
c61ddc1
bb9cc81
24e0c3e
75b42c8
66a0f3c
138d6ac
e804235
4a31afe
2ff0c3b
ea2632c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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. 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 found a typo in the XML, that Fixed in 2ff0c3b -- try with that? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#pragma once | ||
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. Remove until we need it? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#pragma once | ||
|
||
#include <moveit/planning_interface/planning_interface.h> | ||
#include <ktopt_moveit_parameters.hpp> | ||
|
||
// relevant drake includes | ||
#include "drake/multibody/parsing/parser.h" | ||
#include "drake/geometry/scene_graph.h" | ||
#include "drake/systems/framework/diagram.h" | ||
#include "drake/systems/framework/diagram_builder.h" | ||
#include "drake/multibody/plant/multibody_plant.h" | ||
#include "drake/planning/trajectory_optimization/kinematic_trajectory_optimization.h" | ||
#include "drake/solvers/solve.h" | ||
|
||
namespace ktopt_interface | ||
{ | ||
// declare all namespaces to be used | ||
using drake::multibody::MultibodyPlant; | ||
using drake::multibody::AddMultibodyPlantSceneGraph; | ||
using drake::geometry::SceneGraph; | ||
using drake::systems::DiagramBuilder; | ||
using drake::multibody::Parser; | ||
using drake::planning::trajectory_optimization::KinematicTrajectoryOptimization; | ||
using drake::solvers::Solve; | ||
using drake::systems::Diagram; | ||
using drake::systems::Context; | ||
|
||
class KTOptPlanningContext : public planning_interface::PlanningContext | ||
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. TODO Add documentation 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. You mean add comments around the functions and includes? 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. Yes 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. creating issue. |
||
{ | ||
public: | ||
KTOptPlanningContext( | ||
const std::string& name, | ||
const std::string& group_name, | ||
const ktopt_interface::Params& params); | ||
|
||
void solve( | ||
planning_interface::MotionPlanResponse& res) override; | ||
void solve( | ||
planning_interface::MotionPlanDetailedResponse& res) override; | ||
|
||
bool terminate() override; | ||
void clear() override; | ||
|
||
void setRobotDescription(std::string robot_description); | ||
|
||
private: | ||
const ktopt_interface::Params params_; | ||
std::string robot_description_; | ||
|
||
// drake related variables | ||
SceneGraph<double>* scene_graph_{}; | ||
kamiradi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
MultibodyPlant<double>* plant_{}; | ||
std::unique_ptr<Context<double>> diagram_context_; | ||
|
||
|
||
}; | ||
} // namespace ktopt_interface |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<library path="moveit_ktopt_planner_plugin"> | ||
<class name="ktopt_interface/KTOptPlanner" | ||
type="ktopt_interface::KTOptPlannerManager" | ||
base_class_type="planning_interface::PlannerManager"> | ||
<description> | ||
A Drake Kinematic Trajectory Optimization plugin | ||
</description> | ||
</class> | ||
</library> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ktopt_interface: | ||
num_iterations: { | ||
type: int, | ||
description: "dummy", | ||
default_value: 1000, | ||
validation: { | ||
gt_eq<>: [1] | ||
} | ||
} |
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.
@kamiradi @sea-bass I needed to set these properties to avoid a segfault when the plugin was loaded because it couldn't find libdrake at runtime. Let me know what you think