checkpoint_marker_example.cpp
Go to the documentation of this file.
00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 #include <ros/ros.h>
00004 #include "../../src/checkpoint_marker.h"
00005 #include <vector>
00006 
00007 int main(int argc, char **argv)
00008 {
00009     ros::init(argc, argv, "checkpoint_marker_example");
00010 
00011     std::vector<CheckpointRequest> goals;
00012     std::vector<CheckpointRequest>::iterator it;
00013     std::vector<CheckpointRequest>::iterator prev;
00014     std::vector<CheckpointRequest>::iterator others;
00015 
00016     CheckpointMarker marker;
00017 
00018     ros::NodeHandle n;
00019 
00020     ROS_INFO("Please start rviz");
00021     sleep(5);
00022 
00023     for (int i = 0; i < 5; i++) {
00024         CheckpointRequest goal;
00025         goal.id = i;
00026         goal.ref_frame = "/map";
00027         goal.position.x = i;
00028         goal.position.y = i;
00029         goals.push_back(goal);
00030     }
00031 
00032     for (it = goals.begin(); it < goals.end(); it++) {
00033         marker.display_new_checkpoint(* it);
00034         sleep(1);
00035     }
00036 
00037     for (it = goals.begin(); it < goals.end(); it++) {
00038         marker.display_active_checkpoint(* it);
00039         sleep(1);
00040         if (it > goals.begin()) {
00041             prev = it;
00042             prev--;
00043             marker.display_visited_checkpoint(* prev);
00044             sleep(1);
00045         }
00046     }
00047 
00048     return 0;
00049 }


iri_checkpoint_nav
Author(s): Jose Luis Rivero
autogenerated on Fri Dec 6 2013 22:56:28