Skip to content

Commit

Permalink
Apply clang-format-10 (moveit#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
v4hn authored Aug 20, 2020
1 parent 47f052b commit ee6c50a
Show file tree
Hide file tree
Showing 37 changed files with 99 additions and 93 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ BraceWrapping:
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyRecord: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ParallelContainerBase;
* - Fallbacks: the children are considered in series
* - Merger: solutions of all children (actuating disjoint groups)
* are merged into a single solution for parallel execution
*/
*/
class ParallelContainerBase : public ContainerBase
{
public:
Expand Down
4 changes: 2 additions & 2 deletions core/include/moveit/task_constructor/container_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(JointModelGroup)
MOVEIT_CLASS_FORWARD(RobotState)
}
}
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
4 changes: 2 additions & 2 deletions core/include/moveit/task_constructor/marker_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(LinkModel)
}
}
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ namespace core {
MOVEIT_CLASS_FORWARD(LinkModel)
MOVEIT_CLASS_FORWARD(RobotModel)
MOVEIT_CLASS_FORWARD(JointModelGroup)
}
}
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/stage.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
}
}
} // namespace moveit

namespace planning_scene {
MOVEIT_CLASS_FORWARD(PlanningScene)
Expand Down
4 changes: 2 additions & 2 deletions core/include/moveit/task_constructor/stages/compute_ik.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
MOVEIT_CLASS_FORWARD(JointModelGroup)
}
}
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/stages/connect.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
}
}
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(JointModelGroup)
}
}
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace moveit {
namespace core {
class RobotState;
}
}
} // namespace moveit
namespace moveit {
namespace task_constructor {
namespace stages {
Expand Down
6 changes: 3 additions & 3 deletions core/include/moveit/task_constructor/stages/move_to.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace moveit {
namespace core {
class RobotState;
}
}
} // namespace moveit
namespace moveit {
namespace task_constructor {
namespace stages {
Expand Down Expand Up @@ -101,10 +101,10 @@ class MoveTo : public PropagatingEitherWay
bool getJointStateGoal(const boost::any& goal, const core::JointModelGroup* jmg, moveit::core::RobotState& state);
bool getPoseGoal(const boost::any& goal, const geometry_msgs::PoseStamped& ik_pose_msg,
const planning_scene::PlanningScenePtr& scene, Eigen::Isometry3d& target_eigen,
decltype(std::declval<SolutionBase>().markers()) & markers);
decltype(std::declval<SolutionBase>().markers())& markers);
bool getPointGoal(const boost::any& goal, const moveit::core::LinkModel* link,
const planning_scene::PlanningScenePtr& scene, Eigen::Isometry3d& target_eigen,
decltype(std::declval<SolutionBase>().markers()) & /*unused*/);
decltype(std::declval<SolutionBase>().markers())& /*unused*/);

protected:
solvers::PlannerInterfacePtr planner_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotState)
}
}
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down
2 changes: 1 addition & 1 deletion core/include/moveit/task_constructor/stages/simple_grasp.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
}
}
} // namespace moveit
namespace moveit {
namespace task_constructor {
namespace stages {
Expand Down
8 changes: 4 additions & 4 deletions core/include/moveit/task_constructor/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ class Interface : public ordered<InterfaceState*>

// restrict access to some functions to ensure consistency
// (we need to set/unset InterfaceState::owner_)
using base_type::moveTo;
using base_type::moveFrom;
using base_type::insert;
using base_type::erase;
using base_type::insert;
using base_type::moveFrom;
using base_type::moveTo;
using base_type::remove_if;
};

Expand Down Expand Up @@ -329,4 +329,4 @@ struct less<moveit::task_constructor::SolutionBase*>
return *x < *y;
}
};
}
} // namespace std
6 changes: 3 additions & 3 deletions core/include/moveit/task_constructor/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
MOVEIT_CLASS_FORWARD(RobotState)
}
}
} // namespace core
} // namespace moveit

namespace moveit {
namespace task_constructor {
Expand Down Expand Up @@ -108,9 +108,9 @@ class Task : protected WrapperBase
void eraseTaskCallback(TaskCallbackList::const_iterator which);

/// expose SolutionCallback API
using WrapperBase::SolutionCallback;
using WrapperBase::addSolutionCallback;
using WrapperBase::removeSolutionCallback;
using WrapperBase::SolutionCallback;

/// reset all stages
void reset() final;
Expand Down
5 changes: 3 additions & 2 deletions core/include/moveit/task_constructor/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ struct is_container_helper

template <typename T>
struct is_container<
T, std::conditional_t<false, is_container_helper<typename T::const_iterator, decltype(std::declval<T>().cbegin()),
decltype(std::declval<T>().cend())>,
T, std::conditional_t<false,
is_container_helper<typename T::const_iterator, decltype(std::declval<T>().cbegin()),
decltype(std::declval<T>().cend())>,
void> > : public std::true_type
{};
} // namespace task_constructor
Expand Down
2 changes: 1 addition & 1 deletion core/src/introspection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ std::string getProcessId() {
gethostname(our_hostname, sizeof(our_hostname) - 1);
return std::to_string(getpid()) + "@" + our_hostname;
}
}
} // namespace

class IntrospectionPrivate
{
Expand Down
4 changes: 2 additions & 2 deletions core/src/solvers/planner_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ PlannerInterface::PlannerInterface() {
p.declare<double>("max_velocity_scaling_factor", 1.0, "scale down max velocity by this factor");
p.declare<double>("max_acceleration_scaling_factor", 1.0, "scale down max acceleration by this factor");
}
}
}
} // namespace solvers
} // namespace task_constructor
} // namespace moveit
2 changes: 1 addition & 1 deletion core/src/stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ bool Connecting::compatible(const InterfaceState& from_state, const InterfaceSta
auto it = std::find_if(to_attached.cbegin(), to_attached.cend(),
[from_object](const moveit::core::AttachedBody* object) {
return object->getName() == from_object->getName();
});
});
if (it == to_attached.cend()) {
ROS_DEBUG_STREAM_NAMED("Connecting", name() << ": object missing: " << from_object->getName());
return false;
Expand Down
5 changes: 3 additions & 2 deletions core/src/stages/compute_ik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ void ComputeIK::compute() {
double min_solution_distance = props.get<double>("min_solution_distance");

IKSolutions ik_solutions;
auto is_valid = [sandbox_scene, ignore_collisions, min_solution_distance, &ik_solutions](
robot_state::RobotState* state, const robot_model::JointModelGroup* jmg, const double* joint_positions) {
auto is_valid = [sandbox_scene, ignore_collisions, min_solution_distance,
&ik_solutions](robot_state::RobotState* state, const robot_model::JointModelGroup* jmg,
const double* joint_positions) {
for (const auto& sol : ik_solutions) {
if (jmg->distance(joint_positions, sol.data()) < min_solution_distance)
return false; // too close to already found solution
Expand Down
4 changes: 2 additions & 2 deletions core/src/stages/fix_collision_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ bool computeCorrection(const std::vector<cd::Contact>& contacts, Eigen::Vector3d
correction.setZero();
for (const cd::Contact& c : contacts) {
if ((c.body_type_1 != cd::BodyTypes::WORLD_OBJECT && c.body_type_2 != cd::BodyTypes::WORLD_OBJECT)) {
ROS_WARN_STREAM_NAMED("FixCollisionObjects", "Cannot fix collision between " << c.body_name_1 << " and "
<< c.body_name_2);
ROS_WARN_STREAM_NAMED("FixCollisionObjects",
"Cannot fix collision between " << c.body_name_1 << " and " << c.body_name_2);
return false;
}
if (c.body_type_1 == cd::BodyTypes::WORLD_OBJECT)
Expand Down
4 changes: 2 additions & 2 deletions core/src/stages/move_to.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool MoveTo::getJointStateGoal(const boost::any& goal, const moveit::core::Joint

bool MoveTo::getPoseGoal(const boost::any& goal, const geometry_msgs::PoseStamped& ik_pose_msg,
const planning_scene::PlanningScenePtr& scene, Eigen::Isometry3d& target_eigen,
decltype(std::declval<SolutionBase>().markers()) & markers) {
decltype(std::declval<SolutionBase>().markers())& markers) {
try {
const geometry_msgs::PoseStamped& target = boost::any_cast<geometry_msgs::PoseStamped>(goal);
tf::poseMsgToEigen(target.pose, target_eigen);
Expand All @@ -147,7 +147,7 @@ bool MoveTo::getPoseGoal(const boost::any& goal, const geometry_msgs::PoseStampe

bool MoveTo::getPointGoal(const boost::any& goal, const moveit::core::LinkModel* link,
const planning_scene::PlanningScenePtr& scene, Eigen::Isometry3d& target_eigen,
decltype(std::declval<SolutionBase>().markers()) & /*unused*/) {
decltype(std::declval<SolutionBase>().markers())& /*unused*/) {
try {
const geometry_msgs::PointStamped& target = boost::any_cast<geometry_msgs::PointStamped>(goal);
Eigen::Vector3d target_point;
Expand Down
6 changes: 3 additions & 3 deletions core/src/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Task::Task(const std::string& id, bool introspection, ContainerBase::pointer&& c
}

Task::Task(Task&& other) // NOLINT(performance-noexcept-move-constructor)
: WrapperBase(new TaskPrivate(this, std::string()), std::make_unique<SerialContainer>()) {
: WrapperBase(new TaskPrivate(this, std::string()), std::make_unique<SerialContainer>()) {
*this = std::move(other);
}

Expand Down Expand Up @@ -223,7 +223,7 @@ void Task::enableIntrospection(bool enable) {
[](Stage& stage, int /*depth*/) {
stage.pimpl()->setIntrospection(nullptr);
return true;
},
},
1, UINT_MAX);
impl->introspection_.reset();
}
Expand Down Expand Up @@ -275,7 +275,7 @@ void Task::init() {
[impl](Stage& stage, int /*depth*/) {
stage.pimpl()->setIntrospection(impl->introspection_.get());
return true;
},
},
1, UINT_MAX);

// first time publish task
Expand Down
2 changes: 1 addition & 1 deletion core/test/models.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
}
}
} // namespace moveit

// get a hard-coded model
moveit::core::RobotModelPtr getModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ namespace rviz {
class Property;
class PropertyTreeModel;
class DisplayContext;
}
} // namespace rviz
namespace planning_scene {
class PlanningScene;
}
namespace moveit {
namespace task_constructor {
class Stage;
}
}
} // namespace moveit

namespace moveit_rviz_plugin {

Expand Down
4 changes: 2 additions & 2 deletions visualization/motion_planning_tasks/src/icons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ const Icon FORWARD({ { QLatin1String(":icons/downarrow.png"), QColor::fromRgba(0
const Icon BACKWARD({ { QLatin1String(":icons/uparrow.png"), QColor::fromRgba(0xff000000) } }, Icon::TINT);
const Icon BOTHWAY({ { QLatin1String(":icons/updownarrow.png"), QColor::fromRgba(0xff000000) } }, Icon::TINT);
const Icon GENERATE({ { QLatin1String(":icons/generatearrow.png"), QColor::fromRgba(0xff000000) } }, Icon::TINT);
}
}
} // namespace icons
} // namespace moveit_rviz_plugin
4 changes: 2 additions & 2 deletions visualization/motion_planning_tasks/src/icons.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ extern const moveit_rviz_plugin::utils::Icon FORWARD;
extern const moveit_rviz_plugin::utils::Icon BACKWARD;
extern const moveit_rviz_plugin::utils::Icon BOTHWAY;
extern const moveit_rviz_plugin::utils::Icon GENERATE;
}
}
} // namespace icons
} // namespace moveit_rviz_plugin
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ void RemoteSolutionModel::sortInternal() {
if (comp == 0) // if still undecided, id decides
comp = (left->id < right->id ? -1 : 1);
return (sort_order_ == Qt::AscendingOrder) ? (comp < 0) : (comp >= 0);
});
});
}

// map old indexes to new ones
Expand Down
4 changes: 2 additions & 2 deletions visualization/motion_planning_tasks/src/task_display.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
namespace rviz {
class StringProperty;
class RosTopicProperty;
}
} // namespace rviz

namespace moveit {
namespace core {
MOVEIT_CLASS_FORWARD(RobotModel)
}
}
} // namespace moveit
namespace rdf_loader {
MOVEIT_CLASS_FORWARD(RDFLoader)
}
Expand Down
2 changes: 1 addition & 1 deletion visualization/motion_planning_tasks/src/task_list_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ServiceClient;
namespace rviz {
class PropertyTreeModel;
class DisplayContext;
}
} // namespace rviz

namespace moveit_rviz_plugin {

Expand Down
2 changes: 1 addition & 1 deletion visualization/motion_planning_tasks/src/task_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ TaskViewPrivate::TaskViewPrivate(TaskView* q_ptr) : q_ptr(q_ptr), exec_action_cl
}
tasks_view->setExpanded(parent, true); // expand parent group item
}
});
});

tasks_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
tasks_view->setAcceptDrops(true);
Expand Down
4 changes: 2 additions & 2 deletions visualization/motion_planning_tasks/src/task_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class WindowManagerInterface;
class Property;
class BoolProperty;
class EnumProperty;
}
} // namespace rviz

namespace moveit_rviz_plugin {

Expand Down Expand Up @@ -108,7 +108,7 @@ class MetaTaskListModel;
* Subscribing to task_monitoring and task_solution topics, it collects information
* about running tasks and their solutions and allows to inspect both,
* successful solutions and failed solution attempts.
*/
*/
class TaskViewPrivate;
class TaskView : public SubPanel
{
Expand Down
Loading

0 comments on commit ee6c50a

Please sign in to comment.