Toolchain: improve array handling
Adapt the EMAM2RosCpp Project:
For the tag topic=(/autopilot/trajectory_x, nav_msgs/Path), msgField=poses[:].pose.orientation.x)
something like this sould be generated:
void _autopilot_trajectory_xCallback(const nav_msgs::Path::ConstPtr& msg) {
int counter = 0;
for (int i0 = 0; i0 < 1; i0++) {
for (int i1 = 0; i1 < 100; i1++) {
//START NEW GENERATED CODE
if (msg->poses.size() > counter) {
(component->trajectory_x)(i0, i1) =
msg->poses[counter].pose.orientation.x;
} else {
(component->trajectory_x)(i0, i1) = 0;
}
//END NEW GENERATED CODE
counter++;
}
}
}
With this change we will no longer need the python adapter for the autopilot wrapper.