Question: Write a ros nodein c++ called followplan that works as follows. The node subscribes to a topic called commands that delivers messages of type std_msgs::Char
Write a ros nodein c++ called followplanthat works as follows. The node subscribes to a topic calledcommandsthat delivers messages of type std_msgs::Char (characters) and publishes to the topic turtle1/cmd_vel, i.e., velocity commands. The node is both a publisher and a subscriber. If the node receives the character 'F' (forward) it moves the turtle forward 1m. If it receives the character 'B' (back) it moves the turtle back one meter. If it receives the character 'R' (right) it turns clockwise 90 degrees, whereas if it receives the character 'L' (left) it turns counterclockwise 90 degrees.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
