3 #include <sensor_msgs/JointState.h>
26 int main(
int argc,
char **argv)
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();
53 shadowhand->setStateFromYAMLFile(
"package://robowflex_resources/shadowhand/poses/grasp.yml");
54 auto grasp = *shadowhand->getScratchState();
58 RBX_INFO(
"Desired Grasp Displayed, Press Enter to Continue...");
63 for (
const auto &tip :
tips)
65 auto pose = shadowhand->getLinkTF(tip);
73 *shadowhand->getScratchState() = start;
78 RBX_INFO(
"Initial State and Goal Displayed, Press Enter to Continue...");
100 if (not shadowhand->setFromIK(query))
105 RBX_INFO(
"Solution to IK is visualized. Press enter to exit...");
static GeometryPtr makeCylinder(double radius, double length)
Create a cylinder.
RVIZ visualization helper. See Live Visualization with RViz for more information.
void removeAllMarkers()
Removes all markers that were added through addMarker().
void updateMarkers()
Displays the managed list of markers. Keeps track of whether markers have already been displayed and ...
void visualizeCurrentState()
Visualize the current state of the robot.
void updateScene(const SceneConstPtr &scene)
Updates the scene being visualized.
void addTransformMarker(const std::string &name, const std::string &base_frame, const RobotPose &pose, double scale=1)
Add a transform marker to the managed list of markers. Displayed after an updateMarkers() call.
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.
Main namespace. Contains all library classes and functions.
Functions for loading and animating scenes in Blender.
int main(int argc, char **argv)
const std::vector< std::string > tips
bool return_approximate_solution
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...
kinematics::KinematicsQueryOptions options
Other query options.
void addCenteringMetric(double weight=1.)
Add a metric to the query to evaluate how "centered" the joints of the robot are (from their 0 positi...
bool verbose
Verbose output of collision checking.
void addClearanceMetric(double weight=1.)
Add a metric to the query to evaluate clearance from provided scene.
double timeout
Timeout for each query.
SceneConstPtr scene
If provided, use this scene for collision checking.
std::size_t attempts
IK attempts (samples within regions).
void addDistanceMetric(double weight=1.)
Add a metric to the query to evaluate distance to constraint.