/orunav_motion_planner/include/orunav_motion_planner/VehicleMission.h

https://github.com/OrebroUniversity/navigation_oru-release · C Header · 119 lines · 33 code · 22 blank · 64 comment · 0 complexity · 3a7a6cff14404344a218d673c175f785 MD5 · raw file

  1. /**
  2. * @file VehicleMission.h
  3. * @author Marcello Cirillo
  4. *
  5. * Created on: Mar 28, 2013
  6. * Author: marcello
  7. */
  8. #ifndef VEHICLEMISSION_H_
  9. #define VEHICLEMISSION_H_
  10. #include <string>
  11. #include <vector>
  12. #include <math.h>
  13. class Configuration;
  14. #include "VehicleModel.h"
  15. class CarModel;
  16. class LHDModel;
  17. class UnicycleModel;
  18. /**
  19. * @class VehicleMission This class contains the information about the mission
  20. * of a single vehicle: vehicle model, name, ID, initial and goal pose
  21. */
  22. class VehicleMission {
  23. private:
  24. /** The vehicleID_ counter */
  25. static unsigned short int vehicleNum_;
  26. /** The number of active missions */
  27. static unsigned short int activeMissions_;
  28. /** The VehicleModel used for the planning */
  29. VehicleModel* vm_;
  30. /** The initial configuration of the VehicleModel */
  31. Configuration* start_;
  32. /** The desired goal state */
  33. Configuration* goal_;
  34. /** The Vehicle's ID */
  35. unsigned short int vehicleID_;
  36. /** The vehicle's name */
  37. std::string vehicleName_;
  38. /** A map which stores the anti-depression heuristic for the vehicle in Worlds with obstacles: initialized as
  39. * an empty matrix and updated if necessary by the World, it contains the grid distance from goal in the form [y][x] */
  40. std::vector<std::vector<double> > gridDistanceFromGoal_;
  41. public:
  42. /**
  43. * Set a mission for a vehicle: VehicleModel, name (optional) start and goal pose and vehicle name
  44. * @param m
  45. * @param start_x Starting pose, x coordinate
  46. * @param start_y Starting pose, y coordinate
  47. * @param start_o Starting pose, orientation
  48. * @param start_steering Starting pose, steering angle
  49. * @param goal_x Goal pose, x coordinate
  50. * @param goal_y Goal pose, y coordinate
  51. * @param goal_o Goal pose, orientation
  52. * @param goal_steering Goal pose, steering angle
  53. * @param name Name of the vehicle
  54. */
  55. VehicleMission(VehicleModel* m, double start_x, double start_y, double start_o, double start_steering,
  56. double goal_x, double goal_y, double goal_o, double goal_steering, std::string name = "");
  57. ~VehicleMission();
  58. /**
  59. * Assign to the VehicleMission the gridmap of cell-wise distance from goal in a World with
  60. * obstacles.
  61. * @param distances The grid of int with the distances from the goal position of this vehicle
  62. */
  63. void setGridDistanceFromGoal(std::vector<std::vector<double> > distances);
  64. /**
  65. * Get a pointer to the start configuration for this Vehicle's mission
  66. * @return Start configuration of this Vehicle
  67. */
  68. Configuration* getStartConfiguration();
  69. /**
  70. * Get a pointer to the goal configuration for this Vehicle's mission
  71. * @return Goal configuration of this Vehicle
  72. */
  73. Configuration* getGoalConfiguration();
  74. /**
  75. * Get this vehicle's ID
  76. * @return Vehicle's ID
  77. */
  78. unsigned short int getVehicleID();
  79. /**
  80. * Get this vehicle's name
  81. * @return Vehicle's name
  82. */
  83. std::string getVehicleName();
  84. /**
  85. * Get a pointer to this Vehicle's model
  86. * @return A pointer to this vehicle's VehicleModel
  87. */
  88. VehicleModel* getVehicleModel();
  89. /**
  90. * Get the grid distance from any cell to the goal cell for this mission
  91. * @param x The x cell coordinate
  92. * @param y The y cell coordinate
  93. * @return The distance from goal on grid
  94. */
  95. double getGridDistanceFromGoal(int x, int y);
  96. };
  97. #endif /* VEHICLEMISSION_H_ */