Revision e50b15da examples/meka/src/mekajointinterface.cpp
examples/meka/src/mekajointinterface.cpp | ||
---|---|---|
141 | 141 |
//! set the target position of a joint |
142 | 142 |
//! \param enum id of joint |
143 | 143 |
//! \param float value |
144 |
void MekaJointInterface::publish_target_position(int e){
|
|
144 |
void MekaJointInterface::publish_target(int e, float position, float velocity){
|
|
145 | 145 |
//we do this in execute motion for all joints at once... |
146 | 146 |
} |
147 | 147 |
|
... | ... | |
155 | 155 |
msg.joint_names.push_back("head_j1"); |
156 | 156 |
|
157 | 157 |
trajectory_msgs::JointTrajectoryPoint p; |
158 |
p.positions.push_back(joint_target[ID_NECK_TILT] * M_PI / 180.0);
|
|
158 |
p.positions.push_back(get_target_position(ID_NECK_TILT) * M_PI / 180.0);
|
|
159 | 159 |
//pan joint is inverted! |
160 |
p.positions.push_back(-joint_target[ID_NECK_PAN] * M_PI / 180.0);
|
|
160 |
p.positions.push_back(-get_target_position(ID_NECK_PAN) * M_PI / 180.0);
|
|
161 | 161 |
//printf("targets pan=%4.1f tilt=%4.1f (eye p %4.1f t %4.2f)\n",joint_target[ID_NECK_TILT],joint_target[ID_NECK_PAN],joint_target[ID_EYES_LEFT_LR],joint_target[ID_EYES_BOTH_UD]); |
162 | 162 |
|
163 | 163 |
p.time_from_start = ros::Duration(1.2 * 1.0 / humotion::server::Server::MOTION_UPDATERATE); |
Also available in: Unified diff