14 #include "yaml-cpp/yaml.h" 17 #include <gazebo/gazebo_client.hh> 18 #include <gazebo/gazebo_config.h> 19 #include <gazebo/transport/transport.hh> 20 #include <gazebo/msgs/msgs.hh> 29 #include "target.pb.h" 36 #define HAND_PLUGIN_TOPIC "~/hand" 45 public:
static const grasp::msgs::Target_Type
FORCE =
48 public:
static const grasp::msgs::Target_Type
POSITION =
51 public:
static const grasp::msgs::Target_Type
VELOCITY =
57 private: gazebo::transport::NodePtr
node;
59 private: gazebo::transport::PublisherPtr
pub;
61 private: std::vector<std::string>
joints;
63 private: std::map<std::string, double>
state;
65 private: std::vector<GraspShape>
grasps;
75 const std::string & config_file,
76 const std::string & robot);
94 void setPose(ignition::math::Pose3d pose,
double timeout=-1);
97 public:
void reset(
void);
103 bool set_position=
false);
109 bool apply_force=
false);
116 public:
void loop(
void);
123 const char *joint,
double value);
130 std::vector<std::string> & joints,
131 std::vector<double> & values);
static const grasp::msgs::Target_Type POSITION
Position controller target.
Definition: Interface.hh:48
std::string getRobotName()
Gets robot name.
Definition: Interface.cc:92
void openFingers(double timeout=-1, bool set_position=false)
Releases fingers and opens hand.
Definition: Interface.cc:120
std::vector< std::string > joints
Name of actuated robot joints.
Definition: Interface.hh:61
static const grasp::msgs::Target_Type FORCE
Direct force/torque application.
Definition: Interface.hh:45
void moveJoint(const char *joint, double value)
TODO.
Definition: Interface.cc:263
void reset(void)
Sends reset signal to hand plugin.
Definition: Interface.cc:112
static const grasp::msgs::Target_Type VELOCITY
Velocity controller target.
Definition: Interface.hh:51
void moveFingers(double value)
TODO.
std::map< std::string, double > state
Map with (name: value) states of each actuated joint.
Definition: Interface.hh:63
std::vector< GraspShape > grasps
Set of grasp shapes.
Definition: Interface.hh:65
#define POSITION
Position control.
Definition: run_trials.hh:101
bool init(const std::string &config_file, const std::string &robot)
Initalizes interface with config file.
Definition: Interface.cc:35
void setJoints(std::vector< std::string > &joints, std::vector< double > &values)
TODO.
Definition: Interface.cc:275
#define FORCE
Apply force/torque directly.
Definition: HandPlugin.hh:54
Hand interface.
Definition: Interface.hh:42
void setPose(ignition::math::Pose3d pose, double timeout=-1)
Sets hand pose.
Definition: Interface.cc:98
ignition::math::Matrix4d getTransformBaseGripper()
Get T base to gripper frame.
Definition: Interface.cc:86
void raiseHand(double timeout=-1)
Raises hand.
Definition: Interface.cc:174
void loop(void)
TODO.
Definition: Interface.cc:199
ignition::math::Matrix4d t_base_gripper
Rigid transform from base link to gripper frame.
Definition: Interface.hh:67
Interface()
Constructor.
Definition: Interface.cc:11
void closeFingers(double timeout=-1, bool apply_force=false)
Clenches fingers and closes hand.
Definition: Interface.cc:138
int processKeypress(char key)
TODO.
Definition: Interface.cc:221
Grasp shape representation.
std::string robot_name
Name of robot instance in Gazebo.
Definition: Interface.hh:55
gazebo::transport::PublisherPtr pub
Gazebo publisher.
Definition: Interface.hh:59
Useful 3rd party functions.
#define VELOCITY
Velocity control.
Definition: run_trials.hh:103
gazebo::transport::NodePtr node
Gazebo communication node.
Definition: Interface.hh:57