Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Implement Ingestors #164

Merged
merged 2 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions rmf_fleet_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(dep_pkgs
rclcpp
rmf_utils
rmf_dispenser_msgs
rmf_ingestor_msgs
rmf_door_msgs
rmf_fleet_msgs
rmf_lift_msgs
Expand Down Expand Up @@ -65,6 +66,8 @@ target_link_libraries(rmf_fleet_adapter
${rmf_task_msgs_LIBRARIES}
${rmf_door_msgs_LIBRARIES}
${rmf_lift_msgs_LIBRARIES}
${rmf_dispenser_msgs_LIBRARIES}
${rmf_ingestor_msgs_LIBRARIES}
)

target_include_directories(rmf_fleet_adapter
Expand All @@ -78,6 +81,8 @@ target_include_directories(rmf_fleet_adapter
${rmf_task_msgs_INCLUDE_DIRS}
${rmf_door_msgs_INCLUDE_DIRS}
${rmf_lift_msgs_INCLUDE_DIRS}
${rmf_dispenser_msgs_INCLUDE_DIRS}
${rmf_ingestor_msgs_INCLUDE_DIRS}
)

if (BUILD_TESTING)
Expand All @@ -93,6 +98,7 @@ if (BUILD_TESTING)
test/phases/DoorCloseTest.cpp
test/phases/RequestLiftTest.cpp
test/phases/DispenseItemTest.cpp
test/phases/IngestItemTest.cpp
test/phases/test_GoToPlace.cpp
test/services/test_FindEmergencyPullover.cpp
test/services/test_FindPath.cpp
Expand All @@ -108,7 +114,8 @@ if (BUILD_TESTING)
${rmf_task_msgs_INCLUDE_DIRS}
${rmf_door_msgs_INCLUDE_DIRS}
${rmf_lift_msgs_INCLUDE_DIRS}

${rmf_dispenser_msgs_INCLUDE_DIRS}
${rmf_ingestor_msgs_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
)
target_link_libraries(rmf_fleet_adapter_test
Expand All @@ -118,7 +125,8 @@ if (BUILD_TESTING)
${rmf_task_msgs_LIBRARIES}
${rmf_door_msgs_LIBRARIES}
${rmf_lift_msgs_LIBRARIES}

${rmf_dispenser_msgs_LIBRARIES}
${rmf_ingestor_msgs_LIBRARIES}
rmf_fleet_adapter
rmf_utils::rmf_utils
${std_msgs_LIBRARIES}
Expand Down Expand Up @@ -154,6 +162,7 @@ target_link_libraries(full_control
rmf_fleet_adapter
${rmf_task_msgs_LIBRARIES}
${rmf_dispenser_msgs_LIBRARIES}
${rmf_ingestor_msgs_LIBRARIES}
${rmf_door_msgs_LIBRARIES}
${rmf_lift_msgs_LIBRARIES}
${std_msgs_LIBRARIES}
Expand All @@ -163,6 +172,7 @@ target_include_directories(full_control
PRIVATE
${rmf_task_msgs_INCLUDE_DIRS}
${rmf_dispenser_msgs_INCLUDE_DIRS}
${rmf_ingestor_msgs_INCLUDE_DIRS}
${rmf_door_msgs_INCLUDE_DIRS}
${rmf_lift_msgs_INCLUDE_DIRS}
${std_msgs_INCLUDE_DIRS}
Expand Down
4 changes: 4 additions & 0 deletions rmf_fleet_adapter/include/rmf_fleet_adapter/StandardNames.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const std::string DispenserRequestTopicName = "dispenser_requests";
const std::string DispenserResultTopicName = "dispenser_results";
const std::string DispenserStateTopicName = "dispenser_states";

const std::string IngestorRequestTopicName = "ingestor_requests";
const std::string IngestorResultTopicName = "ingestor_results";
const std::string IngestorStateTopicName = "ingestor_states";

const std::string DeliveryTopicName = "delivery_requests";
const std::string LoopRequestTopicName = "loop_requests";
const std::string TaskSummaryTopicName = "task_summaries";
Expand Down
1 change: 1 addition & 0 deletions rmf_fleet_adapter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<depend>rclcpp</depend>
<depend>rmf_utils</depend>
<depend>rmf_door_msgs</depend>
<depend>rmf_ingestor_msgs</depend>
<depend>rmf_dispenser_msgs</depend>
<depend>rmf_fleet_msgs</depend>
<depend>rmf_lift_msgs</depend>
Expand Down
24 changes: 24 additions & 0 deletions rmf_fleet_adapter/src/rmf_fleet_adapter/agv/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ std::shared_ptr<Node> Node::make(
DispenserStateTopicName, default_qos);
node->_emergency_notice_obs = node->create_observable<EmergencyNotice>(
rmf_traffic_ros2::EmergencyTopicName, default_qos);
node->_ingestor_request_pub = node->create_publisher<IngestorRequest>(
IngestorRequestTopicName, default_qos);
node->_ingestor_result_obs = node->create_observable<IngestorResult>(
IngestorResultTopicName, default_qos);
node->_ingestor_state_obs = node->create_observable<IngestorState>(
IngestorStateTopicName, default_qos);

return node;
}
Expand Down Expand Up @@ -127,5 +133,23 @@ auto Node::emergency_notice() const -> const EmergencyNoticeObs&
return _emergency_notice_obs;
}

auto Node::ingestor_request() const -> const IngestorRequestPub&
{
return _ingestor_request_pub;
}

//==============================================================================
auto Node::ingestor_result() const -> const IngestorResultObs&
{
return _ingestor_result_obs;
}

//==============================================================================
auto Node::ingestor_state() const -> const IngestorStateObs&
{
return _ingestor_state_obs;
}


} // namespace agv
} // namespace rmf_fleet_adapter
18 changes: 18 additions & 0 deletions rmf_fleet_adapter/src/rmf_fleet_adapter/agv/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <rmf_dispenser_msgs/msg/dispenser_request.hpp>
#include <rmf_dispenser_msgs/msg/dispenser_result.hpp>
#include <rmf_dispenser_msgs/msg/dispenser_state.hpp>
#include <rmf_ingestor_msgs/msg/ingestor_state.hpp>
#include <rmf_ingestor_msgs/msg/ingestor_result.hpp>
#include <rmf_ingestor_msgs/msg/ingestor_request.hpp>
#include <rmf_door_msgs/msg/door_state.hpp>
#include <rmf_door_msgs/msg/door_request.hpp>
#include <rmf_door_msgs/msg/supervisor_heartbeat.hpp>
Expand Down Expand Up @@ -84,6 +87,18 @@ class Node : public rmf_rxcpp::Transport
using EmergencyNoticeObs = rxcpp::observable<EmergencyNotice::SharedPtr>;
const EmergencyNoticeObs& emergency_notice() const;

using IngestorRequest = rmf_ingestor_msgs::msg::IngestorRequest;
using IngestorRequestPub = rclcpp::Publisher<IngestorRequest>::SharedPtr;
const IngestorRequestPub& ingestor_request() const;

using IngestorResult = rmf_ingestor_msgs::msg::IngestorResult;
using IngestorResultObs = rxcpp::observable<IngestorResult::SharedPtr>;
const IngestorResultObs& ingestor_result() const;

using IngestorState = rmf_ingestor_msgs::msg::IngestorState;
using IngestorStateObs = rxcpp::observable<IngestorState::SharedPtr>;
const IngestorStateObs& ingestor_state() const;

private:

Node(
Expand All @@ -101,6 +116,9 @@ class Node : public rmf_rxcpp::Transport
DispenserResultObs _dispenser_result_obs;
DispenserStateObs _dispenser_state_obs;
EmergencyNoticeObs _emergency_notice_obs;
IngestorRequestPub _ingestor_request_pub;
IngestorResultObs _ingestor_result_obs;
IngestorStateObs _ingestor_state_obs;
};

} // namespace agv
Expand Down