1.Path and Camera Mode Control - Grzegorr/ROS-Thorvald-Robot GitHub Wiki
Introduction:
Path and Camera are controlled using a waypoint based system. The underlying principle is to send a pose to move_base node as a goal and publish the camera mode string message. Then wait for a message from move_base to confirm that goal was reached.
Nodes:
Path and Camera Mode are done by path_controller node, although it should be noted that the camera mode is chosen at every frame by the weed detection script. Also, the navigation stack is used with a lot of use of move_base.
Topics Subscribed:
NONE
Topics Published on:
/move_base/goal - publishing a goal for a move_base node
/camera_mode - publishing the desired camera mode for weed_dtection node
/initialpose - publishing the initial pose for amcl to make sure it locks on to the map correctly
Description of Working Principles:
The node works by initializing "Controller" class and running "driveAroud" method in an infinite while loop. The "Controller" class, when initialized, sets up publishers, publishes initial pose for amcl and loads up a choosen set of waypoints. Each waypoint consists of 7 number and a sting in a single array. The numerical inputs are a pose, position first, then rotation, in frame "map". The string is a desired camera mode, which takes from the following list: "OFF", "Young Lettice", "NoChange", "Grown Lettice", "Anion". The method drive around will count the number of pre-programmed waypoints, then start a following procedure for each of those: publish the waypoint as move_base's goal, wait until waypoint is reached, publish the camera mode, proceed to the next waypoint.
How to run:
There are two ways to run this node. One is to use a "FullLaunch.launch" file in package "ROS", which starts the whole system. Otherwise, "BasicLaunch.launch" can be used and the "path_controller" node by running a "PathController.py" script from package "ROS"
Known Issues:
The robot tends to rotate at a waypoint before reaching a goal. Probably issue with planners. It is compensated for before publishing final map.