How to call ros::init before using node

asked 2021-11-03 12:52:24 -0500

CroCo gravatar image

I'm using Qt GUI to publish data. So far I've managed to configure CMake. Everything is working fine. I can publish data from simple GUI. There is a single concern though which is calling ros::init() which requires the argments. What are other ways to initialize ros without arguments since I don't pass any options from the command line. I'm aware of this page which doesn't suggest any solutions to avoid arguments. Any suggestions?

edit retag flag offensive close merge delete

Comments

Could you clarify what you mean by "initialising ROS without arguments"? Because ros::init(..) does not just "initialise ROS", but it actually initialises your node. I'm not sure how it would do that without you providing it the information it needs.

(there are likely ways to do it, as ros::init(..) calls quite a few functions and you could call those yourself, but it would be good to understand whether it would actually be necessary to do it in your case).

I'm aware of this page which doesn't suggest any solutions to avoid arguments

likely because initialising something without the required information being present is not really possible (or at the very least not something which would be a standard thing to do).

gvdhoorn gravatar image gvdhoorn  ( 2021-11-03 13:25:45 -0500 )edit