32 auto shadowhand = std::make_shared<Robot>(
"shadowhand");
33 shadowhand->initializeFromYAML(
"package://robowflex_resources/shadowhand.yml");
34 shadowhand->loadKinematics(
"all_fingers",
false);
35 shadowhand->setState({
"kuka_arm_1_joint",
"kuka_arm_3_joint",
"kuka_arm_5_joint"}, {1, 2, 1});
37 auto scene = std::make_shared<Scene>(shadowhand);
46 auto start = *shadowhand->getScratchState();
50 rviz.updateScene(
scene);
53 shadowhand->setStateFromYAMLFile(
"package://robowflex_resources/shadowhand/poses/grasp.yml");
54 auto grasp = *shadowhand->getScratchState();
57 rviz.visualizeCurrentState();
58 RBX_INFO(
"Desired Grasp Displayed, Press Enter to Continue...");
63 for (
const auto &tip :
tips)
65 auto pose = shadowhand->getLinkTF(tip);
69 rviz.addTransformMarker(tip +
"_goal",
"map", pose, 0.3);
73 *shadowhand->getScratchState() = start;
76 rviz.visualizeCurrentState();
78 RBX_INFO(
"Initial State and Goal Displayed, Press Enter to Continue...");
90 query.options.return_approximate_solution =
true;
91 query.validate =
true;
92 query.valid_distance = 0.01;
96 query.addDistanceMetric();
97 query.addCenteringMetric(0.01);
98 query.addClearanceMetric(0.01);
100 if (not shadowhand->setFromIK(query))
104 rviz.visualizeCurrentState();
105 RBX_INFO(
"Solution to IK is visualized. Press enter to exit...");
108 rviz.removeAllMarkers();
109 rviz.updateMarkers();
RVIZ visualization helper. See Live Visualization with RViz for more information.
RAII-pattern for starting up ROS.
T emplace_back(T... args)
#define RBX_ERROR(fmt,...)
Output a error logging message.
#define RBX_INFO(fmt,...)
Output a info logging message.
RobotPose createPoseXYZ(double x, double y, double z)
Creates a robot pose from a linear component and zero orientation.
std::shared_ptr< dart::dynamics::CylinderShape > makeCylinder(double radius, double height)
Create a cylinder.
Functions for loading and animating scenes in Blender.
const std::vector< std::string > tips
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...