3#include <chomp/ConstraintFactory.h>
4#include <chomp/Map2D.h>
5#include <chomp/chomputil.h>
6#include <mzcommon/DtGrid.h>
17 ob::PlannerStatus
run(
const og::PathGeometric &path);
27 std::vector<Point> _path;
29 class Map2DCHelper :
public chomp::ChompCollisionHelper {
40 explicit Map2DCHelper(
const Map2D &m)
41 : ChompCollisionHelper(NUM_CSPACE, NUM_WKSPACE, NUM_BODIES), map(m) {}
44 : ChompCollisionHelper(NUM_CSPACE, NUM_WKSPACE, NUM_BODIES), map() {}
46 double getCost(
const MatX &q,
size_t body_index, MatX &dx_dq,
47 MatX &cgrad)
override {
48 assert((q.rows() == 2 && q.cols() == 1) ||
49 (q.rows() == 1 && q.cols() == 2));
51 dx_dq.conservativeResize(3, 2);
54 dx_dq << 1, 0, 0, 1, 0, 0;
56 cgrad.conservativeResize(3, 1);
59 float c = map.sampleCost(vec3f((
float)q(0), (
float)q(1), 0.0), g);
61 cgrad << g[0], g[1], 0.0;
ob::PlannerStatus run(const og::PathGeometric &path)
Definition: CHOMP.cpp:38
std::vector< Point > solutionPath() const
Definition: CHOMP.cpp:127
og::PathGeometric solution() const
Definition: CHOMP.cpp:121
double planningTime() const
Definition: CHOMP.cpp:129
Stopwatch implementation to measure elapsed time.
Definition: Stopwatch.hpp:8