Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Jazzy/Rolling with F2C v1.2.1 #82

Merged
merged 25 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6fad682
[coverage_planning] make it build on rolling with F2C v1.2.1
adivardi Nov 5, 2024
2360f65
fix Werror=maybe-uninitialized
adivardi Nov 21, 2024
16af6a2
restore tests and add missing ament_index_cpp to CMakeLists
adivardi Nov 21, 2024
90577db
update demo launcher for Gazebo Ignition
adivardi Nov 21, 2024
a1c843a
explicitly add models to avoid errors
adivardi Nov 21, 2024
d4b634a
move robot pose and polygon to (0,0)
adivardi Nov 21, 2024
c1b1423
Add .gitignore
adivardi Nov 22, 2024
d54a1d6
Restore robot pose & polygon to (5,5)
adivardi Nov 25, 2024
ad7110e
Update row_coverage_demo_launch.py to Gazebo Ignition
adivardi Nov 25, 2024
247706c
Note on F2C version
adivardi Nov 25, 2024
d8e7df4
Update test workflow
adivardi Nov 25, 2024
ad496a1
lint and format
adivardi Nov 25, 2024
6f749e0
add BTCPP_format to BT xmls
adivardi Nov 26, 2024
8f1946e
CI: change F2C branch and update to Jazzy & Noble
adivardi Nov 26, 2024
cb65987
try F2C v1.2.1
adivardi Nov 27, 2024
8164091
[tmp] ignore F2C compile errors
adivardi Nov 27, 2024
3fc2c29
Update lint step to jazzy
adivardi Nov 27, 2024
3a9e9d1
test with cartesian polygon
adivardi Nov 27, 2024
964bbed
Revert "try F2C v1.2.1"
adivardi Nov 28, 2024
30658a2
Revert "[tmp] ignore F2C compile errors"
adivardi Nov 28, 2024
6a61940
[tmp] rm failing test in opennav_coverage_bt
adivardi Nov 28, 2024
feb6411
switch test to cartesian_frame
adivardi Dec 2, 2024
2f55bc3
restore non-cartesian field test
adivardi Dec 2, 2024
5ff83b3
Revert "[tmp] rm failing test in opennav_coverage_bt"
adivardi Dec 2, 2024
84d85c8
restore rclcpp:shutdown()
adivardi Dec 2, 2024
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
2 changes: 1 addition & 1 deletion .github/deps.repos
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ repositories:
Fields2Cover:
type: git
url: https://github.com/Fields2Cover/Fields2Cover.git
version: main
version: v1.2.1-devel
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-iron-ros-base-latest
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -17,7 +17,7 @@ jobs:
- uses: ros-tooling/[email protected]
with:
linter: ${{ matrix.linter }}
distribution: iron
distribution: jazzy
package-name: |
opennav_coverage
opennav_coverage_bt
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
ROS_DISTRO: ${{ matrix.ros_distro }}
RMW_IMPLEMENTATION: rmw_cyclonedds_cpp
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-latest
image: rostooling/setup-ros-docker:ubuntu-noble-latest
strategy:
fail-fast: false
matrix:
ros_distro: [iron]
ros_distro: [jazzy]
steps:
- uses: actions/checkout@v2
- name: Install Cyclone DDS
Expand All @@ -28,7 +28,7 @@ jobs:
import-token: ${{ secrets.GITHUB_TOKEN }}
target-ros2-distro: ${{ matrix.ros_distro }}
vcs-repo-file-url: "${{ github.workspace }}/.github/deps.repos"
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: colcon-logs
path: ros_ws/log
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Colcon output
build
log
install

# Visual Studio Code files
.vscode

# Eclipse project files
.cproject
.project
.pydevproject

# Python artifacts
__pycache__/
*.py[cod]
.ipynb_checkpoints

sphinx_doc/_build

# CLion artifacts
.idea
cmake-build-debug/

# doxygen docs
doc/html/
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ PS: Click on either image to see the demo videos! :-)

https://github.com/user-attachments/assets/e44d8f10-c5b0-4345-81ad-25f3bcd06030

### Fields2Cover Installation

opennav_coverage works with Field2Cover v1.2.1. The newest version v2.0.0 is not supported at the moment.

To install Fields2Cover, clone it into a colcon workspace and build with `colcon build`.

- Humble & Iron: Use tag `v1.2.1`
- Jazzy & rolling: Use branch `v1.2.1-devel`

## Interfaces

The two main interfaces are `NavigateCompleteCoverage` and `ComputeCoveragePath`. The first is the action definition to request the BT Navigator's `CoverageNavigator` plugin to navigate usign a Complete Coverage task input. The latter is an analog to the `PlannerServer`'s action definition for computing Complete Coverage paths using the `opennav_coverage` action server. See `opennav_coverage_msgs` for complete details.
Expand Down
2 changes: 2 additions & 0 deletions opennav_coverage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.5)
project(opennav_coverage)

find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
Expand Down Expand Up @@ -29,6 +30,7 @@ set(executable_name opennav_coverage)
set(library_name ${executable_name}_core)

set(dependencies
ament_index_cpp
rclcpp
rclcpp_action
rclcpp_lifecycle
Expand Down
1 change: 1 addition & 0 deletions opennav_coverage/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>rclcpp</depend>
<depend>rclcpp_action</depend>
<depend>rclcpp_lifecycle</depend>
Expand Down
2 changes: 1 addition & 1 deletion opennav_coverage/src/coverage_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CoverageServer::on_configure(const rclcpp_lifecycle::State & /*state*/)
node, "coordinates_in_cartesian_frame", rclcpp::ParameterValue(true));
get_parameter("coordinates_in_cartesian_frame", cartesian_frame_);

double action_server_result_timeout;
double action_server_result_timeout = 10.0;
nav2_util::declare_parameter_if_not_declared(
node, "action_server_result_timeout", rclcpp::ParameterValue(10.0));
get_parameter("action_server_result_timeout", action_server_result_timeout);
Expand Down
4 changes: 2 additions & 2 deletions opennav_coverage_bt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ find_package(nav2_behavior_tree REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(opennav_coverage_msgs REQUIRED)
find_package(behaviortree_cpp_v3 REQUIRED)
find_package(behaviortree_cpp REQUIRED)

# potentially replace with nav2_common, nav2_package()
set(CMAKE_CXX_STANDARD 17)
Expand All @@ -33,7 +33,7 @@ set(dependencies
nav_msgs
geometry_msgs
opennav_coverage_msgs
behaviortree_cpp_v3
behaviortree_cpp
)

add_library(opennav_compute_complete_coverage_action_bt_node SHARED src/compute_complete_coverage_path.cpp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
This BT shows field file usage with the row coverage server
-->

<root main_tree_to_execute="MainTree">
<root BTCPP_format="4" main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<RateController hz="0.0000001"> <!-- once, for demo -->
<Sequence name="NavigateWithoutReplanning">
Expand Down
2 changes: 1 addition & 1 deletion opennav_coverage_bt/include/opennav_coverage_bt/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define OPENNAV_COVERAGE_BT__UTILS_HPP_

#include <charconv>
#include "behaviortree_cpp_v3/behavior_tree.h"
#include "behaviortree_cpp/behavior_tree.h"

namespace BT
{
Expand Down
2 changes: 1 addition & 1 deletion opennav_coverage_bt/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<depend>nav_msgs</depend>
<depend>geometry_msgs</depend>
<depend>opennav_coverage_msgs</depend>
<depend>behaviortree_cpp_v3</depend>
<depend>behaviortree_cpp</depend>

<test_depend>ament_lint_common</test_depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion opennav_coverage_bt/src/cancel_complete_coverage_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CoverageCancel::CoverageCancel(

} // namespace opennav_coverage_bt

#include "behaviortree_cpp_v3/bt_factory.h"
#include "behaviortree_cpp/bt_factory.h"
BT_REGISTER_NODES(factory)
{
BT::NodeBuilder builder =
Expand Down
2 changes: 1 addition & 1 deletion opennav_coverage_bt/src/compute_complete_coverage_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void ComputeCoveragePathAction::halt()

} // namespace opennav_coverage_bt

#include "behaviortree_cpp_v3/bt_factory.h"
#include "behaviortree_cpp/bt_factory.h"
BT_REGISTER_NODES(factory)
{
BT::NodeBuilder builder =
Expand Down
4 changes: 2 additions & 2 deletions opennav_coverage_bt/test/test_cancel_complete_coverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <set>
#include <string>

#include "behaviortree_cpp_v3/bt_factory.h"
#include "behaviortree_cpp/bt_factory.h"

#include "nav2_behavior_tree/utils/test_action_server.hpp"
#include "opennav_coverage_bt/cancel_complete_coverage_path.hpp"
Expand Down Expand Up @@ -125,7 +125,7 @@ TEST_F(CancelCoverageActionTestFixture, test_ports)
{
std::string xml_txt =
R"(
<root main_tree_to_execute = "MainTree" >
<root BTCPP_format="4" main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<CancelCoverage name="CoverageCancel"/>
</BehaviorTree>
Expand Down
10 changes: 5 additions & 5 deletions opennav_coverage_bt/test/test_compute_coverage_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "nav_msgs/msg/path.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp"

#include "behaviortree_cpp_v3/bt_factory.h"
#include "behaviortree_cpp/bt_factory.h"

#include "nav2_behavior_tree/utils/test_action_server.hpp"
#include "opennav_coverage_bt/compute_complete_coverage_path.hpp"
Expand Down Expand Up @@ -123,7 +123,7 @@ TEST_F(ComputeCoveragePathActionTestFixture, test_tick)
// create tree
std::string xml_txt =
R"(
<root main_tree_to_execute = "MainTree" >
<root BTCPP_format="4" main_tree_to_execute="MainTree">
<BehaviorTree ID="MainTree">
<ComputeCoveragePath nav_path="{path}"/>
</BehaviorTree>
Expand All @@ -141,13 +141,13 @@ TEST_F(ComputeCoveragePathActionTestFixture, test_tick)

// check if returned path is correct
nav_msgs::msg::Path path;
config_->blackboard->get<nav_msgs::msg::Path>("path", path);
[[maybe_unused]] auto res = config_->blackboard->get<nav_msgs::msg::Path>("path", path);
EXPECT_EQ(path.poses.size(), 2u);
EXPECT_EQ(path.poses[0].pose.position.x, 0.0);
EXPECT_EQ(path.poses[1].pose.position.x, 1.0);

// halt node so another goal can be sent
tree_->rootNode()->halt();
tree_->haltTree();
EXPECT_EQ(tree_->rootNode()->status(), BT::NodeStatus::IDLE);
}

Expand All @@ -169,7 +169,7 @@ int main(int argc, char ** argv)
int all_successful = RUN_ALL_TESTS();

// shutdown ROS
// rclcpp::shutdown();
rclcpp::shutdown();
server_thread.join();

return all_successful;
Expand Down
Loading
Loading