Is using stringstream a recommended option for executing "rosrun" command upon execution of a C++ code?
Hello,
I am trying to work on a project with some pre-existing code. The original author used stringstream to execute rosrun commands. Here is part of that code -
stringstream rosrun;
rosrun<<"rosrun jaco_demo joint_angle_workout.py jaco "<<table[i][0]<<" "<<table[i][1]<<" "<<table[i][2]<<" "<<table[i][3]<<" "<<table[i][4]<<" "<<table[i][5];
system(rosrun.str().c_str());
rosrun.str("");
Where the "table" is just angular input to the Jaco Manipulator.
I wanted to know if the above is recommended as per ROS or not. I am going through nodes, topics, publishers, subscribers, messages and such. The above doesn't seem the best possible way to me for some reason though.
What would you recommend I could do here?