24 auto world = std::make_shared<darts::World>();
27 "package://robowflex_resources/fetch/robots/fetch.urdf",
28 "package://robowflex_resources/fetch/config/fetch.srdf");
31 auto *base_link =
fetch->getFrame(
"base_link");
32 dart::dynamics::PlanarJoint::Properties planar_joint;
33 planar_joint.mName =
"planar_joint";
35 base_link->moveTo<dart::dynamics::PlanarJoint>(
nullptr, planar_joint);
38 fetch->addJointToGroup(
"observation",
"planar_joint");
39 fetch->addJointToGroup(
"observation",
"head_pan_joint");
40 fetch->addJointToGroup(
"observation",
"head_tilt_joint");
42 world->addRobot(
fetch);
45 auto scene = std::make_shared<darts::Structure>(
"object");
46 scene->addGround(-0.01, 10);
50 for (
size_t i = 0; i < nobs; ++i)
52 dart::dynamics::WeldJoint::Properties box_joint;
54 box_joint.mT_ParentBodyToJoint.translation() =
59 for (
size_t i = 0; i < nobs; ++i)
60 for (
size_t j = i + 1; j < nobs; ++j)
63 world->addStructure(
scene);
68 builder.addGroup(
"fetch",
"observation");
70 builder.setStartConfiguration({
76 auto goal = builder.getGoalConfiguration({
80 builder.setGoal(goal);
82 auto rrt = std::make_shared<ompl::geometric::RRTstar>(builder.info);
83 builder.ss->setPlanner(rrt);
90 ompl::base::PlannerStatus solved = builder.ss->solve(5.0);
95 window.animatePath(builder, builder.getSolutionPath(), 10);
A helper class to setup common OMPL structures for planning.
Open Scene Graph GUI for DART visualization.
#define RBX_WARN(fmt,...)
Output a warning logging message.
#define RBX_INFO(fmt,...)
Output a info logging message.
double uniformReal(double lower_bound, double upper_bound)
Generate a random real within given bounds: [lower_bound, upper_bound)
RobotPtr loadMoveItRobot(const std::string &name, const std::string &urdf, const std::string &srdf)
Load a robot from a URDF and SRDF (i.e., a MoveIt enabled robot).
std::shared_ptr< dart::dynamics::BoxShape > makeBox(const Eigen::Ref< const Eigen::Vector3d > &v)
Create a box.
std::string format(const std::string &fmt, Args &&... args)
Recursion base case, return string form of formatted arguments.
Functions for loading and animating scenes in Blender.