1 #ifndef ROBOTINTERFACE_H 2 #define ROBOTINTERFACE_H 6 #include <tf/transform_listener.h> 7 #include <geometry_msgs/Twist.h> 8 #include <geometry_msgs/WrenchStamped.h> 9 #include <sensor_msgs/JointState.h> 10 #include <boost/circular_buffer.hpp> 13 #include "../../support/header/conversions.h" 14 #include "../../support/header/defines.h" 15 #include "../../support/header/formulas.h" 18 #define NELEMENTQUEUEFOR 10 //number of element in queue for force 19 #define NELEMENTQUEUETOR 10 43 int getwTv(Eigen::Matrix4d* wTv_eigen);
45 int sendyDot(std::vector<double> yDot);
47 int getForceTorque(Eigen::Vector3d* force, Eigen::Vector3d* torque);
53 std::string robotName;
54 std::string topicRoot;
55 tf::TransformListener tfListener;
56 ros::Publisher pubTwist;
57 ros::Publisher pubJoint;
58 ros::Subscriber subJointState;
59 ros::Subscriber subForceTorque;
61 std::vector<double> jState_priv;
64 void subJointStateCallback(
const sensor_msgs::JointState& js);
65 void subForceTorqueCallback(
const geometry_msgs::WrenchStamped& msg);
67 std::vector<boost::circular_buffer<double>> vectorForceQueue;
68 std::vector<boost::circular_buffer<double>> vectorTorqueQueue;
75 #endif // ROBOTINTERFACE_H int getJointState(std::vector< double > *jState)
robotInterface::getJointState
robotInterface: a ros node responsible of taken info from simulator and robot sensors, and of given commands back. It is the intermiate layer between actual robot and mission manager ("main")
RobotInterface(ros::NodeHandle nh, std::string robotName)
robotInterface::robotInterface Constructor