@@ -101,6 +101,12 @@ auto CatmullRomSpline::getTrajectory(
101
101
const double start_s, const double end_s, const double resolution, const double offset) const
102
102
-> std::vector<geometry_msgs::msg::Point>
103
103
{
104
+ if (std::fabs (resolution) <= std::numeric_limits<double >::epsilon ()) {
105
+ THROW_SIMULATION_ERROR (
106
+ " Resolution should not be zero." ,
107
+ " This message is not originally intended to be displayed, if you see it, please contact " ,
108
+ " the developer of traffic_simulator." );
109
+ }
104
110
if (start_s > end_s) {
105
111
std::vector<geometry_msgs::msg::Point> ret;
106
112
double s = start_s;
@@ -126,6 +132,12 @@ auto CatmullRomSpline::getTrajectoryPoses(
126
132
const double start_s, const double end_s, const double resolution) const
127
133
-> std::vector<geometry_msgs::msg::Pose>
128
134
{
135
+ if (std::fabs (resolution) <= std::numeric_limits<double >::epsilon ()) {
136
+ THROW_SIMULATION_ERROR (
137
+ " Resolution should not be zero." ,
138
+ " This message is not originally intended to be displayed, if you see it, please contact " ,
139
+ " the developer of traffic_simulator." );
140
+ }
129
141
if (start_s > end_s) {
130
142
std::vector<geometry_msgs::msg::Pose> ret;
131
143
double s = start_s;
0 commit comments