Revision 5cd4364c
examples/yarp_icub/src/icub_jointinterface.cpp | ||
---|---|---|
170 | 170 |
enum_id_bimap.insert(enum_id_bimap_entry_t(icubid, humotionid)); |
171 | 171 |
} |
172 | 172 |
|
173 |
|
|
174 |
|
|
175 |
|
|
176 | 173 |
void iCubJointInterface::run() { |
177 | 174 |
float loop_duration_ms = 1000.0 / MAIN_LOOP_FREQUENCY; |
178 | 175 |
iCubDataReceiver *data_receiver = new iCubDataReceiver(loop_duration_ms, this); |
examples/yarp_icub/src/main.cpp | ||
---|---|---|
79 | 79 |
|
80 | 80 |
icub_jointinterface->run(); |
81 | 81 |
|
82 |
|
|
83 |
// pre-/re-configure some dyn reconfig variables |
|
84 |
int syscall_result; |
|
85 |
syscall_result = std::system(("rosrun dynamic_reconfigure dynparam set " + scope + |
|
86 |
"/humotion/configuration " + |
|
87 |
" \"{'use_neck_target_instead_of_position_eye':false, " + |
|
88 |
"'eyelids_follow_eyemotion':false}\"").c_str()); |
|
89 |
|
|
90 |
if (syscall_result != 0) { |
|
91 |
std::cerr << "ERROR: failed to set dynamic reconf parameters!" << std::endl; |
|
92 |
return EXIT_FAILURE; |
|
93 |
} |
|
94 |
|
|
82 | 95 |
while (humotion_server->ok()) { |
83 | 96 |
usleep(1000); |
84 | 97 |
} |
src/server/eye_motion_generator.cpp | ||
---|---|---|
85 | 85 |
float neck_pan_now = 0.0; |
86 | 86 |
float neck_tilt_now = 0.0; |
87 | 87 |
|
88 |
if (use_neck_target_instead_of_position_eye) { |
|
88 |
if (config->use_neck_target_instead_of_position_eye) {
|
|
89 | 89 |
// position calc based on target |
90 | 90 |
neck_pan_now = joint_interface_->get_target_position(JointInterface::ID_NECK_PAN); |
91 | 91 |
neck_tilt_now = joint_interface_->get_target_position(JointInterface::ID_NECK_TILT); |
src/server/middleware_ros.cpp | ||
---|---|---|
47 | 47 |
ROS_DEBUG_STREAM_NAMED("MiddlewareROS", "no active ros middleware, will call ros::init() " |
48 | 48 |
"now and we will call tick() periodically!\n"); |
49 | 49 |
|
50 |
std::string node_name = "humotion_server__"+ scope;
|
|
50 |
std::string node_name = scope; |
|
51 | 51 |
node_name.erase(std::remove(node_name.begin(), node_name.end(), '/'), node_name.end()); |
52 | 52 |
|
53 | 53 |
ROS_DEBUG_STREAM_NAMED("MiddlewareROS", "registering on ROS as node " << node_name.c_str()); |
src/timestamped_list.cpp | ||
---|---|---|
120 | 120 |
// printf("> latency %3.2fms\n", (Timestamped().to_seconds() - target_ts.to_seconds())*1000.0); |
121 | 121 |
|
122 | 122 |
for ( timestamped_float_list_t::iterator it = tsf_list_.begin(); it != tsf_list_.end(); ++it ) { |
123 |
if (it->timestamp >= target_ts) { |
|
123 |
if (it->timestamp == target_ts) { |
|
124 |
// perfect match, return this value |
|
125 |
return it->value; |
|
126 |
} else if (it->timestamp > target_ts) { |
|
124 | 127 |
// ok found close target |
125 | 128 |
if (it == tsf_list_.begin()) { |
126 | 129 |
// no preceding element |
Also available in: Unified diff