route_speeds.h
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2017, Southwest Research Institute® (SwRI®)
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of Southwest Research Institute® (SwRI®) nor the
14 // names of its contributors may be used to endorse or promote products
15 // derived from this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //
28 // *****************************************************************************
29 #ifndef SWRI_ROUTE_UTIL_ROUTE_SPEEDS_H_
30 #define SWRI_ROUTE_UTIL_ROUTE_SPEEDS_H_
31 
32 #include <marti_common_msgs/KeyValueArray.h>
33 #include <marti_nav_msgs/ObstacleArray.h>
34 #include <marti_nav_msgs/TrackedObjectArray.h>
35 #include <marti_nav_msgs/RouteSpeedArray.h>
37 #include <swri_route_util/route.h>
39 
40 namespace swri_route_util
41 {
43 {
50 
54 
55  // Filter constant used when estimating route curvature. Larger
56  // values result in smoother curvature estimates with fewer spikes.
58 
59 
61 
62  void loadFromRosParam(const ros::NodeHandle &pnh);
63 
64  void loadFromConfig(const marti_common_msgs::KeyValueArray &config);
65  void readToConfig(marti_common_msgs::KeyValueArray &config) const;
66 };
67 
69  marti_nav_msgs::RouteSpeedArray &speeds,
70  const Route &route,
71  const SpeedForCurvatureParameters &parameters);
72 
73 
75 {
80 
83  double max_speed_;
84  double min_speed_;
85 
87 
89 
90  void loadFromRosParam(const ros::NodeHandle &pnh);
91 };
92 
93 // ObstacleData is an intermediate representation for obstacles to
94 // avoid applying transforms and calculating radii repeatedly.
96 {
98  double radius;
99 
100  std::vector<tf::Vector3> polygon;
101 };
102 
103 
105 {
106  // True if the bounding circles touch but the actual polygons do not.
107  bool near;
108  // True if the actual polygons touch.
109  bool collision;
110  size_t route_index;
113  double distance;
114 };
115 
116 // Convert an obstacle array message into a ObstacleData by applying a
117 // transform and calculating the radius of each obstacle.
119  std::vector<ObstacleData> &obstacle_data,
120  const swri_transform_util::Transform g_route_from_obs,
121  const marti_nav_msgs::ObstacleArray &obstacles_msg);
122 
124  std::vector<ObstacleData> &obstacle_data,
125  const swri_transform_util::Transform g_route_from_obs,
126  const marti_nav_msgs::TrackedObjectArray &obstacles_msg);
127 
128 void speedsForObstacles(
129  marti_nav_msgs::RouteSpeedArray &speeds,
130  std::vector<DistanceReport> &reports,
131  const Route &route,
132  const marti_nav_msgs::RoutePosition &route_position,
133  const std::vector<ObstacleData> &obstacles,
134  const SpeedForObstaclesParameters &parameters);
135 } // namespace swri_route_util
136 #endif // SWRI_ROUTE_UTIL_ROUTE_SPEEDS_H_
void speedsForObstacles(marti_nav_msgs::RouteSpeedArray &speeds, std::vector< DistanceReport > &reports, const Route &route, const marti_nav_msgs::RoutePosition &route_position, const std::vector< ObstacleData > &obstacles, const SpeedForObstaclesParameters &parameters)
void readToConfig(marti_common_msgs::KeyValueArray &config) const
void loadFromRosParam(const ros::NodeHandle &pnh)
double max_lateral_accel_mss_
Maximum lateral acceleration in accel mode in m/s^2.
Definition: route_speeds.h:49
void speedsForCurvature(marti_nav_msgs::RouteSpeedArray &speeds, const Route &route, const SpeedForCurvatureParameters &parameters)
void generateObstacleData(std::vector< ObstacleData > &obstacle_data, const swri_transform_util::Transform g_route_from_obs, const marti_nav_msgs::ObstacleArray &obstacles_msg)
std::vector< tf::Vector3 > polygon
Definition: route_speeds.h:100
void loadFromConfig(const marti_common_msgs::KeyValueArray &config)
swri_math_util::Interpolation1D speed_curve_
Definition: route_speeds.h:53


swri_route_util
Author(s):
autogenerated on Tue Apr 6 2021 02:50:48