====== Robotino Potential Field Navigator With Object Pickup ====== **This tutorial is part of the [[robotino_operation|Robotino Operation]] series** The completed project can be downloaded here {{dylanw:robotino_control_pf_pickup.zip}} This is an extension of the [[robotino_vision_pickup|Robotino Vision Pickup]] and [[robotino_pfnav|Robotino Potential Field Navigation]] tutorials. It is recommended that you complete that tutorial before proceeding. ===== Videos ===== The completed project in action. {{youtube>kOHOl9oaBE4?large }} {{youtube>sLznp5lZsg8?large }} ===== Procedure ===== The only functional update to this tutorial from the [[robotino_pfnav|Robotino Potential Field Navigation]] tutorial is in the PFNavNode.cpp. #include "PFNav.h" #include "approach_grab.h" int main(int argc, char **argv) { ros::init(argc, argv, "PFNavNode"); PFNav navigator; approach_grab mygrab; // preapare some points and add them to the potential field. navigator.tileGridGoal(10,2,10); navigator.tileGridObstacle(4,2,20,2); navigator.tileGridObstacle(6,-2,20,2); navigator.tileGridObstacle(8,3,20,2); navigator.navField.printPotentialField(); navigator.setOdom(0,0,0); // set the odometer to 0 navigator.spin(); // start running! mygrab.spinOnce(); // run one loop of our approach grab navigator.tileGridGoal(0,0,10); // go back to the origin navigator.spin(); // Run again! return 0; } As you can see the way to add items to the Navigator's potential field has been simplified. You can also enter the object location in units of DASL floor tiles for convenience. Other than adding the unit conversions in the PFNav class and adding the ability to spinOnce in approach_grab the accompanying classes have remained the same. Here are the prototypes for the added member functions. If you are interested you can find their source in the src directory of the completed package. **PFNav** void tileGridObstacle(float x,float y, float w, float d); void tileGridGoal(float x,float y, float w); **approach_grab** void spinOnce(); ===== Launching your project ===== to launch your project open 4 terminal windows terminal 1 roslaunch robotino_node robotino_node.launch hostname:= terminal 2 rosrun robotino_control BHApose terminal 3 rosrun robotino_control vision terminal 4 rosrun robotino_control approach_grab_node