Skip to content

Commit

Permalink
ros formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
antbono committed Apr 15, 2024
1 parent 6ddfa48 commit 48f4e80
Show file tree
Hide file tree
Showing 12 changed files with 683 additions and 704 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/build_and_test_humble.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: Build (humble)
name: Build and test (humble)

# Controls when the action will run.
on:
Expand Down Expand Up @@ -28,16 +28,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/setup-ros@v0.7
#with:
# use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3
with:
skip-tests: true
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3.7
with:
#skip-tests: true
target-ros2-distro: humble
colcon-defaults: |
{
"build": {
"symlink-install": false
}
}
vcs-repo-file-url: dependencies.repos
16 changes: 5 additions & 11 deletions .github/workflows/build_and_test_iron.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: Build (iron)
name: Build and test (iron)

# Controls when the action will run.
on:
Expand Down Expand Up @@ -28,16 +28,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/setup-ros@v0.7
#with:
# use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3
with:
skip-tests: true
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3.7
with:
#skip-tests: true
target-ros2-distro: iron
colcon-defaults: |
{
"build": {
"symlink-install": false
}
}
vcs-repo-file-url: dependencies.repos
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test_rolling.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: Build (rolling)
name: Build and test (rolling)

# Controls when the action will run.
on:
Expand Down Expand Up @@ -32,6 +32,6 @@ jobs:
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@master
with:
skip-tests: true
#skip-tests: true
target-ros2-distro: rolling
vcs-repo-file-url: dependencies.repos
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build (humble)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_humble.yaml/badge.svg)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_humble.yaml)
[![Build (iron)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_iron.yaml/badge.svg)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_iron.yaml)
[![Build (rolling)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_rolling.yaml/badge.svg)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_rolling.yaml)
[![Build and test (humble)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_humble.yaml/badge.svg)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_humble.yaml)
[![Build and test (iron)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_iron.yaml/badge.svg)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_iron.yaml)
[![Build and test (rolling)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_rolling.yaml/badge.svg)](https://github.com/antbono/nao_led/actions/workflows/build_and_test_rolling.yaml)

# nao_led

Expand Down
6 changes: 3 additions & 3 deletions nao_led_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"msg/LedModes.msg"
"action/LedsPlay.action"
DEPENDENCIES geometry_msgs
)
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

Expand Down
7 changes: 3 additions & 4 deletions nao_led_interfaces/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
<buildtool_depend>ament_cmake</buildtool_depend>

<depend>geometry_msgs</depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>ament_cmake_clang_format</test_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>


<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
4 changes: 2 additions & 2 deletions nao_led_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

Expand Down
110 changes: 55 additions & 55 deletions nao_led_server/include/nao_led_server/led_action_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,68 +18,68 @@
#include <functional>
#include <future>
#include <memory>
#include <string>
#include <sstream>
#include <string>

#include "ament_index_cpp/get_package_share_directory.hpp"
#include "boost/filesystem.hpp"

#include "rclcpp/rclcpp.hpp"
#include "rclcpp_action/rclcpp_action.hpp"
#include "rclcpp_components/register_node_macro.hpp"

#include "nao_led_interfaces/action/leds_play.hpp"
#include "nao_led_interfaces/msg/led_indexes.hpp"
#include "nao_led_interfaces/msg/led_modes.hpp"
#include "nao_lola_command_msgs/msg/chest_led.hpp"
#include "nao_lola_command_msgs/msg/head_leds.hpp"
#include "nao_lola_command_msgs/msg/right_eye_leds.hpp"
#include "nao_lola_command_msgs/msg/left_ear_leds.hpp"
#include "nao_lola_command_msgs/msg/left_eye_leds.hpp"
#include "nao_lola_command_msgs/msg/left_foot_led.hpp"
#include "nao_lola_command_msgs/msg/right_ear_leds.hpp"
#include "nao_lola_command_msgs/msg/left_ear_leds.hpp"
#include "nao_lola_command_msgs/msg/chest_led.hpp"
#include "nao_lola_command_msgs/msg/right_eye_leds.hpp"
#include "nao_lola_command_msgs/msg/right_foot_led.hpp"
#include "nao_lola_command_msgs/msg/left_foot_led.hpp"

#include "nao_led_interfaces/action/leds_play.hpp"
#include "nao_led_interfaces/msg/led_indexes.hpp"
#include "nao_led_interfaces/msg/led_modes.hpp"
#include "nao_led_interfaces/action/leds_play.hpp"

#include "rclcpp/rclcpp.hpp"
#include "rclcpp_action/rclcpp_action.hpp"
#include "rclcpp_components/register_node_macro.hpp"
#include "std_msgs/msg/color_rgba.hpp"

namespace nao_led_action_client {

class LedsPlayActionClient : public rclcpp::Node {
public:
explicit LedsPlayActionClient(const rclcpp::NodeOptions & options = rclcpp::NodeOptions{});
virtual ~LedsPlayActionClient();

void eyesStatic( bool flag );
void headStatic( bool flag );
void earsStatic( bool flag );
void chestStatic( bool flag );
void earsLoop( bool flag );
void headLoop( bool flag );
void eyesLoop( bool flag );

private:

void goalResponseCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr & goal_handle);
void feedbackCallback(
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr,
const std::shared_ptr<const nao_led_interfaces::action::LedsPlay::Feedback> feedback);
void resultCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::WrappedResult & result);


rclcpp_action::Client<nao_led_interfaces::action::LedsPlay>::SharedPtr client_ptr_;

rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr head_goal_handle_;
//std::shared_future<nao_led_interfaces::action::LedsPlay::Impl::CancelGoalService::Response::SharedPtr> head_goal_handle_;
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr eyes_goal_handle_;
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr ears_goal_handle_;


}; // LedsPlayActionClient

} // nao_led_action_client

#endif // NAO_LED_SERVER__LED_ACTION_CLIENT_HPP_
namespace nao_led_action_client
{

class LedsPlayActionClient : public rclcpp::Node
{
public:
explicit LedsPlayActionClient(const rclcpp::NodeOptions & options = rclcpp::NodeOptions{});
virtual ~LedsPlayActionClient();

void eyesStatic(bool flag);
void headStatic(bool flag);
void earsStatic(bool flag);
void chestStatic(bool flag);
void earsLoop(bool flag);
void headLoop(bool flag);
void eyesLoop(bool flag);

private:
void goalResponseCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr &
goal_handle);
void feedbackCallback(
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr,
const std::shared_ptr<const nao_led_interfaces::action::LedsPlay::Feedback> feedback);
void resultCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::WrappedResult &
result);

rclcpp_action::Client<nao_led_interfaces::action::LedsPlay>::SharedPtr client_ptr_;

rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr
head_goal_handle_;
// std::shared_future<nao_led_interfaces::action::LedsPlay::Impl::CancelGoalService::Response::SharedPtr>
// head_goal_handle_;
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr
eyes_goal_handle_;
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr
ears_goal_handle_;

}; // LedsPlayActionClient

} // namespace nao_led_action_client

#endif // NAO_LED_SERVER__LED_ACTION_CLIENT_HPP_
Loading

0 comments on commit 48f4e80

Please sign in to comment.