Skip to content

Commit

Permalink
Clang Format
Browse files Browse the repository at this point in the history
  • Loading branch information
anasarrak committed Jun 17, 2019
1 parent 7f4b0e5 commit 4cd53f4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
#include "rclcpp/time.hpp"
#include "rclcpp/utilities.hpp"


namespace collision_detection
{
static rclcpp::Logger LOGGER_COLLISION_DISTANCE_FIELD = rclcpp::get_logger("moveit").get_child("collision_distance_field");
static rclcpp::Logger LOGGER_COLLISION_DISTANCE_FIELD =
rclcpp::get_logger("moveit").get_child("collision_distance_field");
enum CollisionType
{
NONE = 0,
Expand Down Expand Up @@ -514,8 +514,8 @@ struct ProximityInfo
bool doBoundingSpheresIntersect(const PosedBodySphereDecompositionConstPtr& p1,
const PosedBodySphereDecompositionConstPtr& p2);

void getCollisionSphereMarkers(const std_msgs::msg::ColorRGBA& color, const std::string& frame_id, const std::string& ns,
const rclcpp::Duration& dur,
void getCollisionSphereMarkers(const std_msgs::msg::ColorRGBA& color, const std::string& frame_id,
const std::string& ns, const rclcpp::Duration& dur,
const std::vector<PosedBodySphereDecompositionPtr>& posed_decompositions,
visualization_msgs::msg::MarkerArray& arr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void getBodySphereVisualizationMarkers(const GroupStateRepresentationConstPtr& g
sphere_marker.pose.orientation.z = 0;
sphere_marker.pose.orientation.w = 1;
sphere_marker.color = robot_color;
sphere_marker.lifetime = rclcpp::Duration(0,0);
sphere_marker.lifetime = rclcpp::Duration(0, 0);

const moveit::core::RobotState& state = *(gsr->dfce_->state_);
unsigned int id = 0;
Expand Down Expand Up @@ -193,15 +193,15 @@ void getBodySphereVisualizationMarkers(const GroupStateRepresentationConstPtr& g
const moveit::core::AttachedBody* att = state.getAttachedBody(gsr->dfce_->attached_body_names_[i]);
if (!att)
{
RCLCPP_WARN(LOGGER_COLLISION_DISTANCE_FIELD,"Attached body '%s' was not found, skipping sphere "
"decomposition visualization",
gsr->dfce_->attached_body_names_[i].c_str());
RCLCPP_WARN(LOGGER_COLLISION_DISTANCE_FIELD, "Attached body '%s' was not found, skipping sphere "
"decomposition visualization",
gsr->dfce_->attached_body_names_[i].c_str());
continue;
}

if (gsr->attached_body_decompositions_[i]->getSize() != att->getShapes().size())
{
RCLCPP_WARN(LOGGER_COLLISION_DISTANCE_FIELD,"Attached body size discrepancy");
RCLCPP_WARN(LOGGER_COLLISION_DISTANCE_FIELD, "Attached body size discrepancy");
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ bool collision_detection::getCollisionSphereGradients(const distance_field::Dist
double dist = distance_field->getDistanceGradient(p.x(), p.y(), p.z(), grad.x(), grad.y(), grad.z(), in_bounds);
if (!in_bounds && grad.norm() > EPSILON)
{
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD, "Collision sphere point is out of bounds %lf, %lf, %lf", p.x(), p.y(), p.z());
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD, "Collision sphere point is out of bounds %lf, %lf, %lf", p.x(),
p.y(), p.z());
return true;
}

Expand Down Expand Up @@ -202,7 +203,7 @@ bool collision_detection::getCollisionSphereCollision(const distance_field::Dist

if (!in_bounds && grad.norm() > 0)
{
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD,"Collision sphere point is out of bounds");
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD, "Collision sphere point is out of bounds");
return true;
}

Expand Down Expand Up @@ -315,7 +316,7 @@ void collision_detection::BodyDecomposition::init(const std::vector<shapes::Shap
bodies::mergeBoundingSpheres(bounding_spheres, relative_bounding_sphere_);

RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD, "BodyDecomposition generated %i collision spheres out of %i shapes",
collision_spheres_.size(), shapes.size());
collision_spheres_.size(), shapes.size());
}

collision_detection::BodyDecomposition::~BodyDecomposition()
Expand Down Expand Up @@ -405,8 +406,9 @@ bool collision_detection::doBoundingSpheresIntersect(const PosedBodySphereDecomp
}

void collision_detection::getCollisionSphereMarkers(
const std_msgs::msg::ColorRGBA& color, const std::string& frame_id, const std::string& ns, const rclcpp::Duration& dur,
const std::vector<PosedBodySphereDecompositionPtr>& posed_decompositions, visualization_msgs::msg::MarkerArray& arr)
const std_msgs::msg::ColorRGBA& color, const std::string& frame_id, const std::string& ns,
const rclcpp::Duration& dur, const std::vector<PosedBodySphereDecompositionPtr>& posed_decompositions,
visualization_msgs::msg::MarkerArray& arr)
{
unsigned int count = 0;
rclcpp::Clock ros_clock;
Expand Down Expand Up @@ -445,8 +447,8 @@ void collision_detection::getProximityGradientMarkers(
if (gradients.size() != posed_decompositions.size() + posed_vector_decompositions.size())
{
RCLCPP_WARN(LOGGER_COLLISION_DISTANCE_FIELD, "Size mismatch between gradients %u and decompositions %u",
(unsigned int)gradients.size(),
(unsigned int)(posed_decompositions.size() + posed_vector_decompositions.size()));
(unsigned int)gradients.size(),
(unsigned int)(posed_decompositions.size() + posed_vector_decompositions.size()));
return;
}
for (unsigned int i = 0; i < gradients.size(); i++)
Expand Down Expand Up @@ -479,13 +481,13 @@ void collision_detection::getProximityGradientMarkers(
else
{
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD, "Negative length for %u %d %lf", i, arrow_mark.id,
gradients[i].gradients[j].norm());
gradients[i].gradients[j].norm());
}
}
else
{
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD , "Negative dist %lf for %u %d", gradients[i].distances[j], i,
arrow_mark.id);
RCLCPP_DEBUG(LOGGER_COLLISION_DISTANCE_FIELD, "Negative dist %lf for %u %d", gradients[i].distances[j], i,
arrow_mark.id);
}
arrow_mark.points.resize(2);
if (i < posed_decompositions.size())
Expand Down Expand Up @@ -549,7 +551,7 @@ void collision_detection::getCollisionMarkers(
if (gradients.size() != posed_decompositions.size() + posed_vector_decompositions.size())
{
RCLCPP_WARN(LOGGER_COLLISION_DISTANCE_FIELD, "Size mismatch between gradients %zu and decompositions %zu",
gradients.size(), posed_decompositions.size() + posed_vector_decompositions.size());
gradients.size(), posed_decompositions.size() + posed_vector_decompositions.size());
return;
}
for (unsigned int i = 0; i < gradients.size(); i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ void CollisionRobotDistanceField::addLinkBodyDecompositions(
link_body_decomposition_vector_.push_back(bd);
link_body_decomposition_index_map_[link_models[i]->getName()] = link_body_decomposition_vector_.size() - 1;
}
RCLCPP_DEBUG(LOGGER_COLLISION_ROBOT_DISTANCE_FIELD, " Finished ");
RCLCPP_DEBUG(LOGGER_COLLISION_ROBOT_DISTANCE_FIELD, " Finished ");
}

PosedBodySphereDecompositionPtr CollisionRobotDistanceField::getPosedLinkBodySphereDecomposition(
Expand Down

0 comments on commit 4cd53f4

Please sign in to comment.