Skip to content

Commit

Permalink
Remove compiler warnings (#44)
Browse files Browse the repository at this point in the history
* Remove compiler warnings

Signed-off-by: Ryan Friedman <[email protected]>

* Remove remaining warnings

Signed-off-by: Ryan Friedman <[email protected]>

---------

Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 authored Feb 21, 2024
1 parent 4587b42 commit ff8f038
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
6 changes: 2 additions & 4 deletions terrain_navigation/include/terrain_navigation/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ class Path {
* @param closest_point
* @param tangent
* @param curvature
* @param epsilon
*/
void getClosestPoint(const Eigen::Vector3d &position, Eigen::Vector3d &closest_point, Eigen::Vector3d &tangent,
double &curvature, double epsilon = 0.001) {
double &curvature) {
closest_point = segments.front().states.front().position;

// Iterate through all segments
Expand Down Expand Up @@ -121,7 +120,6 @@ class Path {
}

PathSegment &getCurrentSegment(const Eigen::Vector3d &position) {
double theta{-std::numeric_limits<double>::infinity()};
Eigen::Vector3d closest_point;
Eigen::Vector3d tangent;
double curvature;
Expand Down Expand Up @@ -150,7 +148,7 @@ class Path {
}
}

int getCurrentSegmentIndex(const Eigen::Vector3d &position, double epsilon = 0.1) {
int getCurrentSegmentIndex(const Eigen::Vector3d &position) {
Eigen::Vector3d closest_point;
Eigen::Vector3d tangent;
double curvature;
Expand Down
6 changes: 3 additions & 3 deletions terrain_navigation/include/terrain_navigation/path_segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct State {
Eigen::Vector4d attitude;
};

static void wrap_2pi(double &angle) {
inline void wrap_2pi(double &angle) {
while ((angle < 0.0) || (angle > 2 * M_PI)) {
if (angle < 0.0) {
angle += 2 * M_PI;
Expand All @@ -58,7 +58,7 @@ static void wrap_2pi(double &angle) {
}
}

static void wrap_pi(double &angle) {
inline void wrap_pi(double &angle) {
while (std::abs(angle) > M_PI) {
if (angle > 0)
angle = angle - 2 * M_PI;
Expand Down Expand Up @@ -207,7 +207,7 @@ class PathSegment {
if (states.size() == 1) {
// Segment only contains a single state, meaning that it is nor a line or a arc
theta = 1.0;
} else if (std::abs(curvature) < 0.0001) {
} else if (std::abs(curvature) < epsilon) {
// Compute closest point on a line segment
// Get Path Progress
theta = getLineProgress(position, segment_start, segment_end);
Expand Down
4 changes: 2 additions & 2 deletions terrain_navigation/src/data_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ void DataLogger::writeToFile(const std::string path) {

for (auto data : data_list_) {
for (auto key : keys_) {
if (std::string* s = std::any_cast<std::string>(&data.at(key))) {
if (std::any_cast<std::string>(&data.at(key))) {
output_file << std::any_cast<std::string&>(data.at(key)) << field_seperator;
} else if (double* i = std::any_cast<double>(&data.at(key))) {
} else if (std::any_cast<double>(&data.at(key))) {
output_file << std::any_cast<double&>(data.at(key)) << field_seperator;
}
}
Expand Down
1 change: 0 additions & 1 deletion terrain_planner/src/DubinsAirplane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,6 @@ void DubinsAirplaneStateSpace::getStateOnCircle(const ob::State* from, int rl /*
}

unsigned int DubinsAirplaneStateSpace::convert_idx(unsigned int i) const {
assert(i >= 0u && "In convert_idx, i < 0");
assert(i < 6u && "In convert_idx, i > 5");
switch (i) {
case 0: // start helix
Expand Down

0 comments on commit ff8f038

Please sign in to comment.