Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changed clang-format style to Google; updated clang-format runner in …
…GH workflows to use modern pip version of clang-format

Signed-off-by: Peter Geurts <[email protected]>
  • Loading branch information
geurto authored and Jelmerdw committed Oct 30, 2025
commit 224079cfadb5789c487e8bebd1cecc80266010db
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#
# SPDX-License-Identifier: Apache-2.0
Language: Cpp
BasedOnStyle: LLVM
BasedOnStyle: Google

InsertNewlineAtEOF: true
SeparateDefinitionBlocks: Always
SortIncludes: true
IncludeBlocks: Regroup
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt update && sudo apt install -y clang-format
- run: find ros2_ws/src -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format --dry-run --Werror
- run: python3 -m pip install clang-format
- run: find ros2_ws/src -iname '*.h' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format --dry-run --Werror --style=file

doxygen:
runs-on: ubuntu-latest
Expand Down
42 changes: 25 additions & 17 deletions ros2_ws/src/rcdt_moveit/include/moveit_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
//
// # SPDX-License-Identifier: Apache-2.0

#include <moveit_visual_tools/moveit_visual_tools.h>

#include <geometry_msgs/msg/pose_stamped.hpp>
#include <moveit/move_group_interface/move_group_interface.hpp>
#include <moveit/planning_scene_interface/planning_scene_interface.hpp>
#include <moveit/robot_model/joint_model_group.hpp>
#include <moveit_msgs/srv/servo_command_type.hpp>
#include <moveit_visual_tools/moveit_visual_tools.h>
#include <rcdt_messages/srv/add_marker.hpp>
#include <rcdt_messages/srv/add_object.hpp>
#include <rcdt_messages/srv/define_goal_pose.hpp>
Expand All @@ -33,23 +34,23 @@ typedef rcdt_messages::srv::ExpressPoseInOtherFrame ExpressPoseInOtherFrame;
* Class to interact with the Moveit framework.
*/
class MoveitManager {
public:
public:
/**
* @brief constructor for the MoveitManager class.
* @param node The ROS2 node to attach to.
*/
MoveitManager(rclcpp::Node::SharedPtr node);

private:
private:
rclcpp::Node::SharedPtr node; /**< ROS2 node with MoveIt Services */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously instead of using /**< ... */ I simply used // ..., is the /**< ... */ version the neater way of commenting behind a variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for Doxygen to recognize the comment as a docstring, it needs to be formatted a certain way. See: https://www.doxygen.nl/manual/docblocks.html

rclcpp::Node::SharedPtr
client_node; /**< ROS2 node with ExpressPoseInOtherFrame Client */
moveit::planning_interface::MoveGroupInterface
move_group; /**< Interface for setting joint/pose goals */
moveit::planning_interface::PlanningSceneInterface
planning_scene_interface; /**< Interface for adding collision objects */
const moveit::core::JointModelGroup
*joint_model_group; /**< Joint models for planning trajectories */
const moveit::core::JointModelGroup*
joint_model_group; /**< Joint models for planning trajectories */
moveit_visual_tools::MoveItVisualTools
moveit_visual_tools; /**< Visualization tools */
PoseStamped goal_pose; /**< Goal pose to move end-effector to */
Expand Down Expand Up @@ -93,8 +94,8 @@ class MoveitManager {
std::shared_ptr<Trigger::Response> response);

rclcpp::Service<DefineGoalPose>::SharedPtr
define_goal_pose_service; /**< Service to define goal pose for arm to move
to */
define_goal_pose_service; /**< Service to define goal
pose for arm to move to */

/**
* @brief Callback to define goal pose for arm to move to.
Expand All @@ -115,9 +116,9 @@ class MoveitManager {
* translation.
* @param response Response indicating whether the service call succeeded.
*/
void
transform_goal_pose(const std::shared_ptr<TransformGoalPose::Request> request,
std::shared_ptr<TransformGoalPose::Response> response);
void transform_goal_pose(
const std::shared_ptr<TransformGoalPose::Request> request,
std::shared_ptr<TransformGoalPose::Response> response);

rclcpp::Service<MoveToConf>::SharedPtr
move_to_configuration_service; /**< Service to move to a specified
Expand All @@ -132,8 +133,8 @@ class MoveitManager {
std::shared_ptr<MoveToConf::Response> response);

rclcpp::Service<MoveHandToPose>::SharedPtr
move_hand_to_pose_service; /**< Service to move hand to a specified goal
Pose */
move_hand_to_pose_service; /**< Service to move hand to
a specified goal Pose */

/**
* @brief Callback to move arm to a specified goal Pose.
Expand All @@ -145,8 +146,8 @@ class MoveitManager {
std::shared_ptr<MoveHandToPose::Response> response);

rclcpp::Service<AddMarker>::SharedPtr
add_marker_service; /**< Service to add a visual marker at a specified
Pose */
add_marker_service; /**< Service to add a visual marker at a
specified Pose */

/**
* @brief Callback to add a visual marker at a specified location.
Expand All @@ -169,9 +170,16 @@ class MoveitManager {
std::shared_ptr<Trigger::Response> response);

// Methods:
void initialize_clients(); /**< Initializes the ExpressPoseInOtherFrame
service client Node and Client */
void initialize_services(); /**< Initializes all MoveIt Services */
/**
* @brief Initializes the ExpressPoseInOtherFrame service client Node and
* Client.
*/
void initialize_clients();

/**
* @brief Initializes all MoveIt Services
*/
void initialize_services();

/**
* @brief Method to change a specified Pose to a world-fixed frame.
Expand Down
2 changes: 1 addition & 1 deletion ros2_ws/src/rcdt_moveit/src/moveit_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void MoveitManager::clear_markers(
response->success = true;
}

int main(int argc, char **argv) {
int main(int argc, char** argv) {
rclcpp::init(argc, argv);
rclcpp::NodeOptions node_options;
node_options.automatically_declare_parameters_from_overrides(true);
Expand Down