Revision 2aa96942 src/server/controller.cpp
| src/server/controller.cpp | ||
|---|---|---|
| 39 | 39 |
|
| 40 | 40 |
using humotion::server::Controller; |
| 41 | 41 |
using humotion::server::Config; |
| 42 |
using humotion::server::debug_data_t; |
|
| 42 | 43 |
|
| 43 | 44 |
//! constructor |
| 44 | 45 |
Controller::Controller(JointInterface *j) {
|
| ... | ... | |
| 82 | 83 |
void Controller::calculate_targets() {
|
| 83 | 84 |
Controller::motion_generator_vector_t::iterator it; |
| 84 | 85 |
for (it = motion_generator_vector_.begin(); it < motion_generator_vector_.end(); it++) {
|
| 85 |
(*it)->calculate_targets(); |
|
| 86 |
MotionGenerator *mg = *it; |
|
| 87 |
// calculate targets |
|
| 88 |
mg->calculate_targets(); |
|
| 86 | 89 |
} |
| 87 | 90 |
} |
| 88 | 91 |
|
| 92 |
debug_data_t Controller::get_debug_data() {
|
|
| 93 |
debug_data_t debug_data; |
|
| 94 |
|
|
| 95 |
Controller::motion_generator_vector_t::iterator it; |
|
| 96 |
for (it = motion_generator_vector_.begin(); it < motion_generator_vector_.end(); it++) {
|
|
| 97 |
MotionGenerator *mg = *it; |
|
| 98 |
// fetch and append debug data |
|
| 99 |
debug_data_t dataset = mg->get_debug_data(); |
|
| 100 |
debug_data.insert(dataset.begin(), dataset.end()); |
|
| 101 |
} |
|
| 102 |
|
|
| 103 |
return debug_data; |
|
| 104 |
} |
|
| 105 |
|
|
| 89 | 106 |
//! publish all target angles to the devices: |
| 90 | 107 |
//! NOTE: this is done in an extra loop to have a low delay between consequent sets: |
| 91 | 108 |
void Controller::publish_targets() {
|
Also available in: Unified diff