Skip to content

Commit

Permalink
ci build
Browse files Browse the repository at this point in the history
  • Loading branch information
antbono committed Apr 15, 2024
1 parent 91fbb0f commit 2257799
Show file tree
Hide file tree
Showing 30 changed files with 1,732 additions and 1,670 deletions.
9 changes: 2 additions & 7 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 and Test (humble)
name: Build (humble)

# Controls when the action will run.
on:
Expand Down Expand Up @@ -32,11 +32,6 @@ jobs:
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3
with:
skip-tests: true
target-ros2-distro: humble
colcon-defaults: |
{
"build": {
"symlink-install": false
}
}
vcs-repo-file-url: dependencies.repos
9 changes: 2 additions & 7 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 and Test (iron)
name: Build (iron)

# Controls when the action will run.
on:
Expand Down Expand Up @@ -32,11 +32,6 @@ jobs:
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@v0.3
with:
skip-tests: true
target-ros2-distro: iron
colcon-defaults: |
{
"build": {
"symlink-install": false
}
}
vcs-repo-file-url: dependencies.repos
9 changes: 2 additions & 7 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 and Test (rolling)
name: Build (rolling)

# Controls when the action will run.
on:
Expand Down Expand Up @@ -32,11 +32,6 @@ jobs:
use-ros2-testing: true
- uses: ros-tooling/action-ros-ci@master
with:
skip-tests: true
target-ros2-distro: rolling
colcon-defaults: |
{
"build": {
"symlink-install": false
}
}
vcs-repo-file-url: dependencies.repos
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,3 @@ you need only move the limbs of interest in the desired manner and the robot wil


For more info, please refer to the related [paper](https://arxiv.org/abs/2403.13960).


### Note on CI

The failing status is due to the colcon `--symlink-install` option that [action-ros-ci](https://github.com/ros-tooling/action-ros-ci) uses. At the moment the symlinking cannot be disabled but we are actively working with action-ros-ci maintainers (see issue [815](https://github.com/ros-tooling/action-ros-ci/issues/815)).
4 changes: 2 additions & 2 deletions hni_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,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
45 changes: 21 additions & 24 deletions hni_cpp/include/hni_cpp/chat_action_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <array>
#include <cstring>
#include <functional>
#include <iostream> // std::cout
#include <iostream> // std::cout
#include <memory>
#include <string> // std::string, std::stof
#include <string> // std::string, std::stof
#include <thread>
#include <unordered_map>
//#include <vector>
Expand All @@ -37,31 +37,28 @@
#include "rclcpp_components/register_node_macro.hpp"
#include "std_srvs/srv/set_bool.hpp"

namespace hni_chat_action_client {
namespace hni_chat_action_client
{

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

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

void sendAsyncGoal();
void goalResponseCallback(
const rclcpp_action::ClientGoalHandle<hni_interfaces::action::ChatPlay>::SharedPtr & goal_handle);
void feedbackCallback(
rclcpp_action::ClientGoalHandle<hni_interfaces::action::ChatPlay>::SharedPtr,
const std::shared_ptr<const hni_interfaces::action::ChatPlay::Feedback> feedback);
void resultCallback(
const rclcpp_action::ClientGoalHandle<hni_interfaces::action::ChatPlay>::WrappedResult & result);
rclcpp_action::Client<hni_interfaces::action::ChatPlay>::SharedPtr client_ptr_;
rclcpp::TimerBase::SharedPtr timer_;

}; // ChatActionClient

rclcpp_action::Client<hni_interfaces::action::ChatPlay>::SharedPtr client_ptr_;
rclcpp::TimerBase::SharedPtr timer_;
} // namespace hni_chat_action_client


}; // ChatActionClient

} // hni_chat_action_client

#endif // HNI_MOVES__CHAT_ACTION_CLIENT_HPP_
#endif // HNI_MOVES__CHAT_ACTION_CLIENT_HPP_
161 changes: 76 additions & 85 deletions hni_cpp/include/hni_cpp/chat_action_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include <array>
#include <cstring>
#include <functional>
#include <iostream> // std::cout
#include <iostream> // std::cout
#include <memory>
#include <string> // std::string, std::stof
#include <string> // std::string, std::stof
#include <thread>
#include <unordered_map>
//#include <vector>
Expand All @@ -45,89 +45,80 @@
#include "rclcpp_components/register_node_macro.hpp"
#include "std_srvs/srv/set_bool.hpp"


namespace hni_chat_action_server {


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

private:

// services clients
rclcpp::Client<std_srvs::srv::SetBool>::SharedPtr gstt_srv_client_;
rclcpp::Client<hni_interfaces::srv::TextToSpeech>::SharedPtr gtts_srv_client_;
rclcpp::Client<hni_interfaces::srv::Chat>::SharedPtr chat_srv_client_;

//client classes
//std::shared_ptr<hni_led_action_client::LedsPlayActionClient> led_srv_client_;

// chat play action server
rclcpp_action::Server<hni_interfaces::action::ChatPlay>::SharedPtr action_server_;
std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle_;
rclcpp_action::GoalResponse handleGoal(
const rclcpp_action::GoalUUID & uuid,
std::shared_ptr<const hni_interfaces::action::ChatPlay::Goal> goal);
rclcpp_action::CancelResponse handleCancel(
const std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle);
void handleAccepted(
const std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle);
void execute(
const std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle);


// joints play action client
rclcpp_action::Client<hni_interfaces::action::JointsPlay>::SharedPtr joints_act_client_;
void jointsPlayGoalResponseCallback(
const rclcpp_action::ClientGoalHandle<hni_interfaces::action::JointsPlay>::SharedPtr & goal_handle);
void jointsPlayFeedbackCallback(
rclcpp_action::ClientGoalHandle<hni_interfaces::action::JointsPlay>::SharedPtr,
const std::shared_ptr<const hni_interfaces::action::JointsPlay::Feedback> feedback);
void jointsPlayResultCallback(
const rclcpp_action::ClientGoalHandle<hni_interfaces::action::JointsPlay>::WrappedResult & result);

//leds play action client
rclcpp_action::Client<nao_led_interfaces::action::LedsPlay>::SharedPtr leds_play_act_client_;

void ledsPlayGoalResponseCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr & goal_handle);
void ledsPlayFeedbackCallback(
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr,
const std::shared_ptr<const nao_led_interfaces::action::LedsPlay::Feedback> feedback);
void ledsPlayResultCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::WrappedResult & result);


// parameters
const double kSecPerWord_ ;
const double kForwardParam_ ;
std::unordered_map<std::string,std::string> moves_map_;

/*
std::shared_ptr<hni_joints_play_action_client::JointsPlayActionClient> joints_play_client_;
std::shared_ptr<hni_gstt_service_client::GsttServiceClient> gstt_srv_client_;
std::shared_ptr<hni_gtts_service_client::GttsServiceClient> gtts_srv_client_;
std::shared_ptr<hni_chat_service_client::ChatServiceClient> chat_srv_client_;
*/

rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::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_;
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr chest_goal_handle_;

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


namespace hni_chat_action_server
{

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

private:
// services clients
rclcpp::Client<std_srvs::srv::SetBool>::SharedPtr gstt_srv_client_;
rclcpp::Client<hni_interfaces::srv::TextToSpeech>::SharedPtr gtts_srv_client_;
rclcpp::Client<hni_interfaces::srv::Chat>::SharedPtr chat_srv_client_;

// client classes
// std::shared_ptr<hni_led_action_client::LedsPlayActionClient> led_srv_client_;

// chat play action server
rclcpp_action::Server<hni_interfaces::action::ChatPlay>::SharedPtr action_server_;
std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle_;
rclcpp_action::GoalResponse handleGoal(const rclcpp_action::GoalUUID& uuid,
std::shared_ptr<const hni_interfaces::action::ChatPlay::Goal> goal);
rclcpp_action::CancelResponse
handleCancel(const std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle);
void
handleAccepted(const std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle);
void execute(const std::shared_ptr<rclcpp_action::ServerGoalHandle<hni_interfaces::action::ChatPlay>> goal_handle);

// joints play action client
rclcpp_action::Client<hni_interfaces::action::JointsPlay>::SharedPtr joints_act_client_;
void jointsPlayGoalResponseCallback(
const rclcpp_action::ClientGoalHandle<hni_interfaces::action::JointsPlay>::SharedPtr& goal_handle);
void jointsPlayFeedbackCallback(rclcpp_action::ClientGoalHandle<hni_interfaces::action::JointsPlay>::SharedPtr,
const std::shared_ptr<const hni_interfaces::action::JointsPlay::Feedback> feedback);
void jointsPlayResultCallback(
const rclcpp_action::ClientGoalHandle<hni_interfaces::action::JointsPlay>::WrappedResult& result);

// leds play action client
rclcpp_action::Client<nao_led_interfaces::action::LedsPlay>::SharedPtr leds_play_act_client_;

void ledsPlayGoalResponseCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr& goal_handle);
void ledsPlayFeedbackCallback(rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr,
const std::shared_ptr<const nao_led_interfaces::action::LedsPlay::Feedback> feedback);
void ledsPlayResultCallback(
const rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::WrappedResult& result);

// parameters
const double kSecPerWord_;
const double kForwardParam_;
std::unordered_map<std::string, std::string> moves_map_;

/*
std::shared_ptr<hni_joints_play_action_client::JointsPlayActionClient> joints_play_client_;
std::shared_ptr<hni_gstt_service_client::GsttServiceClient> gstt_srv_client_;
std::shared_ptr<hni_gtts_service_client::GttsServiceClient> gtts_srv_client_;
std::shared_ptr<hni_chat_service_client::ChatServiceClient> chat_srv_client_;
*/

rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::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_;
rclcpp_action::ClientGoalHandle<nao_led_interfaces::action::LedsPlay>::SharedPtr chest_goal_handle_;

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

}
} // namespace hni_chat_action_server

#endif // HNI_CPP__CHAT_ACTION_SERVER_HPP_
#endif // HNI_CPP__CHAT_ACTION_SERVER_HPP_
25 changes: 10 additions & 15 deletions hni_cpp/include/hni_cpp/chat_service_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,21 @@
#include "rclcpp/rclcpp.hpp"
#include "rclcpp_components/register_node_macro.hpp"

namespace hni_chat_service_client
{


namespace hni_chat_service_client {


class ChatServiceClient : public rclcpp::Node {

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

std::string sendSyncReq(std::string & phrase);

private:
std::string sendSyncReq(std::string& phrase);

private:
rclcpp::Client<hni_interfaces::srv::Chat>::SharedPtr client_ptr_;

};

} // namespace hni_chat_service_client

} // namespace hni_gstt_service_client

#endif //HNI_CPP__CHAT_SERVICE_CLIENT_HPP_
#endif // HNI_CPP__CHAT_SERVICE_CLIENT_HPP_
Loading

0 comments on commit 2257799

Please sign in to comment.