ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
declare the instance as pointer variable to the class member, and use the new to create the instance whenever it is required in the class.
for example:
class AC{
ActionClient ac_;
AC(string name) {
ac_= new ActionClient(name, true);
} };
make sure you clear the pointer after use. I am beginner too. please correct if I have any mistakes.