Convert rostopic pub into c++ code
How do i convert a rostopic pub command and run it in a C++ script? I would like to pub the gripper angle when i state the position of the robot arm but i cant seam to control the gripper.
rostopic pub gripper_angle std_msgs/UInt16 0-180
Where the 0-180 is the angles and you edit the angle of the gripper you want it to be. Normally the rostopic pub is sent from the terminal. The c++ script will be run from the terminal which will be run using rosrun.
I hope yoou guys can help me. Thanks.