Revision e8e20dfe
examples/meka/src/main.cpp | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
|
25 | 25 |
//create humotion interface |
26 |
string scope = "/xsc3/";
|
|
26 |
string scope = "/"; |
|
27 | 27 |
MekaJointInterface *jointinterface = new MekaJointInterface(scope); |
28 | 28 |
humotion::server::Server *humotion_server = new humotion::server::Server("/flobi", "ROS", jointinterface); |
29 | 29 |
|
examples/meka/src/mekajointinterface.cpp | ||
---|---|---|
14 | 14 |
//printf("incoming data for joint '%s'\n", name.c_str()); |
15 | 15 |
|
16 | 16 |
int id = -1; |
17 |
if (name == "NECK_PAN"){
|
|
17 |
if (name == "head_j1"){
|
|
18 | 18 |
id = ID_NECK_PAN; |
19 |
}else if(name == "NECK_TILT"){
|
|
19 |
}else if(name == "head_j0"){
|
|
20 | 20 |
id = ID_NECK_TILT; |
21 | 21 |
} |
22 | 22 |
|
... | ... | |
132 | 132 |
msg.joint_names.push_back("head_j0"); |
133 | 133 |
msg.joint_names.push_back("head_j1"); |
134 | 134 |
|
135 |
trajectory_msgs::JointTrajectoryPoint p[2];
|
|
136 |
p[0].positions.push_back(joint_target[ID_NECK_PAN] * M_PI / 180.0);
|
|
137 |
p[1].positions.push_back(joint_target[ID_NECK_TILT]* M_PI / 180.0);
|
|
135 |
trajectory_msgs::JointTrajectoryPoint p; |
|
136 |
p.positions.push_back(joint_target[ID_NECK_TILT] * M_PI / 180.0);
|
|
137 |
p.positions.push_back(joint_target[ID_NECK_PAN] * M_PI / 180.0);
|
|
138 | 138 |
|
139 |
p[0].time_from_start = ros::Duration(1.2 * 1.0 / humotion::server::Server::MOTION_UPDATERATE);
|
|
140 |
p[1].time_from_start = ros::Duration(1.2 * 1.0 / humotion::server::Server::MOTION_UPDATERATE);
|
|
139 |
p.time_from_start = ros::Duration(1.2 * 1.0 / humotion::server::Server::MOTION_UPDATERATE); |
|
140 |
p.time_from_start = ros::Duration(1.2 * 1.0 / humotion::server::Server::MOTION_UPDATERATE); |
|
141 | 141 |
|
142 |
msg.points.push_back(p[0]); |
|
143 |
msg.points.push_back(p[1]); |
|
142 |
msg.points.push_back(p); |
|
144 | 143 |
|
145 | 144 |
target_publisher.publish(msg); |
146 | 145 |
|
Also available in: Unified diff