dynamic subscribers
Dear all, I'm developing a ROS GUI in C++ with Qt. In the GUI, I would like to offer the possibility to reconfigure the ROS communications through some kind of configuration settings window. The idea is save this configuration in a file and read it to dynamically subscribe to the list of topics chosen by the user. The problem is that in the callbacks function I have to specify the type of the incoming message. For example:
void Collector::poseChangesCallback(const common::PoseChanges::ConstPtr& msg) {
accelx= msg->dx;
accely= msg->dy;
accelz= msg->dy;
}
I think I could obtain the ROS types and params messages before execute the node, but I am not really sure that it could work well. Have someone try this before? Are there any other better mechanism to attempt this?
Thanks.