Project

General

Profile

Revision 5d0687a9

ID5d0687a9991d806c94fc7c21405334e6717e3611

Added by Priya over 7 years ago

Small changes to wireless, and starting turning with line following.

View differences:

scout/libscout/src/behaviors/WH_Robot.cpp
24 24
{
25 25
  ROS_INFO("WH_robot: Executing a task");
26 26
  assert(curr_task != DEFAULT_TASK);
27
  //TODO: do task
27
  
28
  Path new_path = nav_map->shortest_path(curr_task->get_dest());
29
  curr_task->set_path(new_path);
30
  for(int i=0; i<new_path.len; i++)
31
  {
32
    Turn t = new_path.path[i];
33
    ROS_INFO("making turn %d at state %d", (int)t, (int)nav_map->get_state());
34
    nav_map->update_state(t);
35
    Duration time = nav_map->get_time_remaining();
36
    while(time.sec > 0)
37
      time = nav_map->get_time_remaining();
38
  }
39
  ROS_INFO("Path complete at state %d", (int)nav_map->get_state());
28 40
  srand(0xDEADBEEF);
29 41
  int error = rand() % 12;
30
  if(error < 9) //Fail with 1/4 probability
42
  if(error < 6) //Fail with 1/2 probability
31 43
  {
32 44
    ROS_INFO("WH_robot: TASK COMPLETE!");
33 45
    return TASK_COMPLETED;

Also available in: Unified diff