28 #include <robot/robot.h> 29 #include <robot/hand.h> 30 #include <robot/hand_protocol.h> 76 for (
unsigned int i = START_OF_ARM; i < NUM_HAND_JOINTS; ++i)
78 std::string name = hand_joints[i].joint_name;
83 ROS_INFO(
"NAME[%d]: %s ", i, name.c_str());
94 JointsMap::iterator iter =
joints_map.find(joint_name);
102 if (target < hand_joints[index_arm_joints].min_angle)
104 target = hand_joints[index_arm_joints].min_angle;
106 if (target > hand_joints[index_arm_joints].max_angle)
108 target = hand_joints[index_arm_joints].max_angle;
112 robot_update_sensor(&hand_joints[index_arm_joints].joint_target, target);
117 ROS_DEBUG(
"Joint %s not found", joint_name.c_str());
126 JointsMap::iterator iter =
joints_map.find(joint_name);
131 ROS_ERROR(
"Joint %s not found.", joint_name.c_str());
135 noData.temperature = 0.0;
136 noData.current = 0.0;
139 noData.jointIndex = 0;
149 tmpData.
position = robot_read_sensor(&hand_joints[index].position);
150 tmpData.
target = robot_read_sensor(&hand_joints[index].joint_target);
174 ROS_WARN(
"The setContrl method is not yet implemented");
180 ROS_WARN(
"The getContrl method is not yet implemented");
187 ROS_WARN(
"The set config function is not implemented in the virtual arm.");
193 ROS_WARN(
"The get config function is not implemented in the virtual arm.");
199 std::vector <DiagnosticData> returnVect;
210 tmpDiag.
target = it->second.target;
212 tmpDiag.
position = it->second.position;
214 returnVect.push_back(tmpDiag);
std::string flags
a string containing flags: FORCE, TEMPERATURE, ... indicating the different cutouts / warning sent by...
std::string joint_name
the name of the joint
virtual int16_t setContrl(std::string contrlr_name, JointControllerData ctrlr_data)
std::map< std::string, JointData > JointsMap
int target_sensor_num
the channel number of the target sensor
int position_sensor_num
the channel number of the position sensor
virtual JointData getJointData(std::string joint_name)
virtual JointsMap getAllJointsData()
JointsMap joints_map
A mapping between the joint names and the information regarding those joints.
virtual int16_t setConfig(std::vector< std::string > myConfig)
This is a parent class for the different types of Shadowhand we can have. It makes it possible to swa...
virtual std::vector< DiagnosticData > getDiagnostics()
boost::mutex joints_map_mutex
virtual void getConfig(std::string joint_name)
int16_t level
the level of alert: 0 = OK, 1 = WARNING, 2 = ERROR
The real arm is a ROS interface to Shadow Robot muscle arm.
double target
the actual value of the target
virtual int16_t sendupdate(std::string joint_name, double target)
double position
the actual value of the position
virtual JointControllerData getContrl(std::string ctrlr_name)