Skip to content

Commit

Permalink
⬆️ new version of ROSA, using rosa_task_plan_bt
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezenders committed May 9, 2024
1 parent ead170a commit b32455b
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions suave_rosa_bt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ find_package(behaviortree_cpp REQUIRED)
find_package(mavros_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rosa_msgs REQUIRED)
find_package(rosa_plan REQUIRED)
find_package(rosa_task_plan_bt REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)

Expand All @@ -24,7 +24,7 @@ set(dependencies
mavros_msgs
rclcpp
rosa_msgs
rosa_plan
rosa_task_plan_bt
std_msgs
std_srvs
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/bool.hpp"

#include "rosa_plan/rosa_action.hpp"
#include "rosa_task_plan_bt/rosa_action.hpp"

using namespace std::placeholders;

namespace suave_rosa_bt
{

template<class T>
class InspectPipeline : public rosa_plan::RosaAction<T>{
class InspectPipeline : public rosa_task_plan_bt::RosaAction<T>{

public:
InspectPipeline(
const std::string& name, const BT::NodeConfig & conf)
: rosa_plan::RosaAction<T>(name, conf), _pipeline_inspected(false)
: rosa_task_plan_bt::RosaAction<T>(name, conf), _pipeline_inspected(false)
{
pipeline_inspected_sub_ = this->_node->template create_subscription<std_msgs::msg::Bool>(
"/pipeline/inspected",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/bool.hpp"

#include "rosa_plan/rosa_action.hpp"
#include "rosa_task_plan_bt/rosa_action.hpp"

using namespace std::placeholders;

namespace suave_rosa_bt
{

template<class T>
class RechargeBattery : public rosa_plan::RosaAction<T>{
class RechargeBattery : public rosa_task_plan_bt::RosaAction<T>{

public:
RechargeBattery(
const std::string& name, const BT::NodeConfig & conf)
: rosa_plan::RosaAction<T>(name, conf)
: rosa_task_plan_bt::RosaAction<T>(name, conf)
{
battery_level_sub = this->_node->template create_subscription<std_msgs::msg::Bool>(
"/battery_monitor/recharge/complete",
Expand All @@ -46,7 +46,7 @@ class RechargeBattery : public rosa_plan::RosaAction<T>{
std::cout << "Async action starting: " << this->name() << std::endl;
// _completion_time = std::chrono::system_clock::now() + std::chrono::milliseconds(5000);
_recharged = false;
return rosa_plan::RosaAction<T>::onStart();
return rosa_task_plan_bt::RosaAction<T>::onStart();
};

BT::NodeStatus onRunning() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/bool.hpp"

#include "rosa_plan/rosa_action.hpp"
#include "rosa_task_plan_bt/rosa_action.hpp"

using namespace std::placeholders;

namespace suave_rosa_bt
{

template<class T>
class SearchPipeline : public rosa_plan::RosaAction<T>{
class SearchPipeline : public rosa_task_plan_bt::RosaAction<T>{

public:
SearchPipeline(
const std::string& name, const BT::NodeConfig & conf)
: rosa_plan::RosaAction<T>(name, conf), _pipeline_detected(false)
: rosa_task_plan_bt::RosaAction<T>(name, conf), _pipeline_detected(false)
{
pipeline_detection_sub_ = this->_node->template create_subscription<std_msgs::msg::Bool>(
"/pipeline/detected",
Expand All @@ -44,7 +44,7 @@ class SearchPipeline : public rosa_plan::RosaAction<T>{

BT::NodeStatus onStart(){
this->_node->template set_search_started();
return rosa_plan::RosaAction<T>::onStart();
return rosa_task_plan_bt::RosaAction<T>::onStart();
};

BT::NodeStatus onRunning() override{
Expand Down
3 changes: 2 additions & 1 deletion suave_rosa_bt/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>rosa_task_plan_bt</build_depend>

<depend>rosa_kb</depend>
<depend>rosa_msgs</depend>
<depend>rosa_plan</depend>
<depend>rosa_bringup</depend>
<depend>suave</depend>
<depend>suave_msgs</depend>
Expand Down
4 changes: 2 additions & 2 deletions suave_rosa_bt/src/suave_rosa_bt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "suave_rosa_bt/arm_thrusters.hpp"
#include "suave_rosa_bt/set_guided_mode.hpp"
#include "suave_rosa_bt/suave_mission.hpp"
#include "rosa_plan/is_action_feasible.hpp"
#include "rosa_task_plan_bt/is_action_feasible.hpp"

int main(int argc, char * argv[])
{
Expand All @@ -41,7 +41,7 @@ int main(int argc, char * argv[])
factory.registerNodeType<suave_rosa_bt::InspectPipeline<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("inspect_pipeline");
factory.registerNodeType<suave_rosa_bt::RechargeBattery<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("recharge");

factory.registerNodeType<rosa_plan::IsActionFeasible<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("IsActionFeasible");
factory.registerNodeType<rosa_task_plan_bt::IsActionFeasible<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("IsActionFeasible");

factory.registerNodeType<suave_rosa_bt::ArmThrusters>("ArmThrusters");
factory.registerNodeType<suave_rosa_bt::SetGuidedMode>("SetGuidedMode");
Expand Down
4 changes: 2 additions & 2 deletions suave_rosa_bt/src/suave_rosa_bt_extended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "suave_rosa_bt/suave_mission.hpp"
#include "suave_rosa_bt/is_pipeline_found.hpp"
#include "suave_rosa_bt/is_pipeline_inspected.hpp"
#include "rosa_plan/is_action_feasible.hpp"
#include "rosa_task_plan_bt/is_action_feasible.hpp"

int main(int argc, char * argv[])
{
Expand All @@ -43,7 +43,7 @@ int main(int argc, char * argv[])
factory.registerNodeType<suave_rosa_bt::InspectPipeline<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("inspect_pipeline");
factory.registerNodeType<suave_rosa_bt::RechargeBattery<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("recharge");

factory.registerNodeType<rosa_plan::IsActionFeasible<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("IsActionFeasible");
factory.registerNodeType<rosa_task_plan_bt::IsActionFeasible<std::shared_ptr<suave_rosa_bt::SuaveMission>>>("IsActionFeasible");
factory.registerNodeType<suave_rosa_bt::IsPipelineFound>("IsPipelineFound");
factory.registerNodeType<suave_rosa_bt::IsPipelineInspected>("IsPipelineInspected");

Expand Down
5 changes: 5 additions & 0 deletions suave_rosa_plansys/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<depend>rosa_msgs</depend>
<depend>rosa_task_plan_plansys</depend>
<depend>rclcpp</depend>
<depend>rosa_kb</depend>
<depend>suave</depend>
<depend>suave_msgs</depend>
<depend>mavros</depend>
<depend>mavros_msgs</depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
Expand Down

0 comments on commit b32455b

Please sign in to comment.