Skip to content

Commit

Permalink
renamed c1t -> cda1tenth (#19)
Browse files Browse the repository at this point in the history
* renamed c1t -> cda1tenth

* fixed ci

* renamed include directories

* changed strategy back to carma/port_drayage

* fixed strategy

* changed to navigation2-extensions
  • Loading branch information
john-chrosniak authored Nov 7, 2024
1 parent 4c4f5ec commit 174086e
Show file tree
Hide file tree
Showing 31 changed files with 114 additions and 114 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,36 @@ jobs:
- name: Clone Dep's
run: |
git clone https://github.com/usdot-fhwa-stol/carma-msgs
git clone -b nav2_route_server_humble https://github.com/usdot-fhwa-stol/navigation2
working-directory: /__w/navigation2_extensions/navigation2_extensions/src
git clone -b route-server-develop https://github.com/usdot-fhwa-stol/navigation2
working-directory: /__w/navigation2-extensions/navigation2-extensions/src

- name: Install Ros dependencies
run: |
sudo apt-get update
apt install -y libnanoflann-dev unzip build-essential wget
rosdep update
rosdep install --from-paths /__w/navigation2_extensions/navigation2_extensions/src --ignore-src --rosdistro=humble -y -r
working-directory: /__w/navigation2_extensions/navigation2_extensions/src/navigation2_extensions
rosdep install --from-paths /__w/navigation2-extensions/navigation2-extensions/src --ignore-src --rosdistro=humble -y -r
working-directory: /__w/navigation2-extensions/navigation2-extensions/src/navigation2-extensions

- name: Setup Build Wrapper
run: |
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
working-directory: /__w/navigation2_extensions/navigation2_extensions/
working-directory: /__w/navigation2-extensions/navigation2-extensions/

- name: Build with Build Wrapper
run: |
. /opt/ros/humble/setup.sh
./build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output \
colcon build --parallel-workers 4 --event-handlers console_direct+ --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug"
working-directory: /__w/navigation2_extensions/navigation2_extensions/
working-directory: /__w/navigation2-extensions/navigation2-extensions/

- name: Run tests
shell: bash
run: |
source /__w/navigation2_extensions/navigation2_extensions/install/setup.bash
colcon test --parallel-workers 4 --event-handlers console_direct+ --ctest-args -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" --packages-select carma_nav2_port_drayage_demo
working-directory: /__w/navigation2_extensions/navigation2_extensions/
source /__w/navigation2-extensions/navigation2-extensions/install/setup.bash
colcon test --parallel-workers 4 --event-handlers console_direct+ --ctest-args -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_BUILD_TYPE="Debug" --packages-select nav2_port_drayage_demo
working-directory: /__w/navigation2-extensions/navigation2-extensions/

- name: Setup SonarScanner
uses: warchant/setup-sonar-scanner@v7
Expand All @@ -65,26 +65,26 @@ jobs:
sonar.projectKey=usdot-fhwa-stol_navigation2-extensions
sonar.organization=usdot-fhwa-stol
sonar.sourceEncoding=UTF-8
sonar.cfamily.build-wrapper-output=/__w/navigation2_extensions/navigation2_extensions/bw-output/
sonar.cfamily.build-wrapper-output=/__w/navigation2-extensions/navigation2-extensions/bw-output/
sonar.host.url=https://sonarcloud.io
sonar.cpp.file.suffixes=.cpp,.h,.tpp
sonar.c.file.suffixes=-
sonar.scm.provider=git
carma_nav2_behavior_tree.sonar.projectBaseDir=/__w/navigation2_extensions/navigation2_extensions/src/navigation2_extensions/carma_nav2_behavior_tree
carma_nav2_behavior_tree.sonar.exclusions=test/**
carma_nav2_behavior_tree.sonar.tests=test
carma_nav2_emergency_stop.sonar.projectBaseDir=/__w/navigation2_extensions/navigation2_extensions/src/navigation2_extensions/carma_nav2_emergency_stop
carma_nav2_emergency_stop.sonar.sources=src
carma_nav2_emergency_stop.sonar.exclusions=test/**
carma_nav2_port_drayage_demo.sonar.projectBaseDir=/__w/navigation2_extensions/navigation2_extensions/src/navigation2_extensions/carma_nav2_port_drayage_demo
carma_nav2_port_drayage_demo.sonar.sources=src
carma_nav2_port_drayage_demo.sonar.exclusions=test/**
carma_nav2_port_drayage_demo.sonar.tests=test
nav2_route_server_behavior_tree.sonar.projectBaseDir=/__w/navigation2-extensions/navigation2-extensions/src/navigation2-extensions/nav2_route_server_behavior_tree
nav2_route_server_behavior_tree.sonar.exclusions=test/**
nav2_route_server_behavior_tree.sonar.tests=test
nav2_emergency_stop.sonar.projectBaseDir=/__w/navigation2-extensions/navigation2-extensions/src/navigation2-extensions/nav2_emergency_stop
nav2_emergency_stop.sonar.sources=src
nav2_emergency_stop.sonar.exclusions=test/**
nav2_port_drayage_demo.sonar.projectBaseDir=/__w/navigation2-extensions/navigation2-extensions/src/navigation2-extensions/nav2_port_drayage_demo
nav2_port_drayage_demo.sonar.sources=src
nav2_port_drayage_demo.sonar.exclusions=test/**
nav2_port_drayage_demo.sonar.tests=test
EOF
- name: Run SonarScanner
uses: usdot-fhwa-stol/actions/sonar-scanner@main
with:
sonar-properties-path: /tmp/sonar-scanner.properties
sonar-token: ${{ secrets.SONAR_TOKEN }}
working-dir: /__w/navigation2_extensions/navigation2_extensions/src/navigation2_extensions/
working-dir: /__w/navigation2-extensions/navigation2-extensions/src/navigation2-extensions/
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ ARG VERSION="NULL"
ARG VCS_REF="NULL"
ENV ROS_DISTRO=humble

RUN mkdir -p /root/c1t_ws/src/navigation2_extensions
RUN mkdir -p /root/cda_ws/src/navigation2_extensions

COPY . /root/c1t_ws/src/navigation2_extensions/
COPY docker/install_dependencies.sh /root/c1t_ws/
COPY docker/build.sh /root/c1t_ws/
COPY . /root/cda_ws/src/navigation2_extensions/
COPY docker/install_dependencies.sh /root/cda_ws/
COPY docker/build.sh /root/cda_ws/

WORKDIR /root/c1t_ws/
WORKDIR /root/cda_ws/

RUN chmod +x ./install_dependencies.sh ./build.sh
RUN ./install_dependencies.sh
RUN ./build.sh

LABEL org.label-schema.schema-version="1.0" \
org.label-schema.name="navigation2-extensions" \
org.label-schema.description="CARMA 1tenth nav2 extensions" \
org.label-schema.description="CDA1Tenth nav2 extensions" \
org.label-schema.vendor="Leidos" \
org.label-schema.version="${VERSION}" \
org.label-schema.url="https://highways.dot.gov/research/research-programs/operations/CARMA" \
Expand Down
2 changes: 1 addition & 1 deletion docker/get-system-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
# License for the specific language governing permissions and limitations under
# the License.

SYSTEM_TAG_PREFIX="c1t"
SYSTEM_TAG_PREFIX="cda1tenth"

git describe --all --match="$SYSTEM_TAG_PREFIX*" --always --dirty="-SNAPSHOT" | awk -F "/" '{print $NF}'
2 changes: 1 addition & 1 deletion docker/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set -e
sudo apt-get update
# Install
apt install -y libnanoflann-dev
git clone https://github.com/usdot-fhwa-stol/carma-msgs /root/c1t_ws/src/carma-msgs && git clone -b nav2_route_server_humble https://github.com/usdot-fhwa-stol/navigation2 /root/c1t_ws/src/navigation2
git clone https://github.com/usdot-fhwa-stol/carma-msgs /root/cda_ws/src/carma-msgs && git clone -b route-server-develop https://github.com/usdot-fhwa-stol/navigation2 /root/cda_ws/src/navigation2
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=humble -y -r
4 changes: 2 additions & 2 deletions init-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ if [ -f "/opt/ros/humble/setup.bash" ]; then
source /opt/ros/humble/setup.bash
fi

if [ -f "/root/c1t_ws/install/setup.bash" ]; then
source /root/c1t_ws/install/setup.bash
if [ -f "/root/cda_ws/install/setup.bash" ]; then
source /root/cda_ws/install/setup.bash
fi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.22)
project(carma_nav2_emergency_stop)
project(nav2_emergency_stop)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

ament_auto_add_library(carma_nav2_emergency_stop
ament_auto_add_library(nav2_emergency_stop
src/emergency_stop.cpp
)

ament_auto_add_executable(carma_nav2_emergency_stop_node
ament_auto_add_executable(nav2_emergency_stop_node
src/emergency_stop_node.cpp
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `carma_nav2_emergency_stop` package
# `nav2_emergency_stop` package

This package adds emergency stop functionality to shutdown the Navigation2 stack and send a halt command when the center button on the Logitech Gamepad F710 is pushed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef CARMA_NAV2_EMERGENCY_STOP__EMERGENCY_STOP_HPP_
#define CARMA_NAV2_EMERGENCY_STOP__EMERGENCY_STOP_HPP_
#ifndef NAV2_EMERGENCY_STOP__EMERGENCY_STOP_HPP_
#define NAV2_EMERGENCY_STOP__EMERGENCY_STOP_HPP_

#include <nav2_util/lifecycle_node.hpp>
#include <nav2_util/lifecycle_service_client.hpp>
#include <rclcpp_lifecycle/lifecycle_node.hpp>
#include <ackermann_msgs/msg/ackermann_drive_stamped.hpp>
#include <sensor_msgs/msg/joy.hpp>

namespace carma_nav2_emergency_stop
namespace nav2_emergency_stop
{

class EmergencyStop : public rclcpp::Node
Expand All @@ -41,6 +41,6 @@ class EmergencyStop : public rclcpp::Node
// The names of the nodes to be managed, in the order of desired bring-up
std::vector<std::string> node_names_;
};
} // namespace carma_nav2_emergency_stop
} // namespace nav2_emergency_stop

#endif // CARMA_NAV2_EMERGENCY_STOP__EMERGENCY_STOP_HPP_
#endif // NAV2_EMERGENCY_STOP__EMERGENCY_STOP_HPP_
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>carma_nav2_emergency_stop</name>
<name>nav2_emergency_stop</name>
<version>0.1.0</version>
<description>An emergency stop for navigation2</description>
<maintainer email="carma@dot.gov">CARMA Support</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "carma_nav2_emergency_stop/emergency_stop.hpp"
#include "nav2_emergency_stop/emergency_stop.hpp"

namespace carma_nav2_emergency_stop
namespace nav2_emergency_stop
{

EmergencyStop::EmergencyStop(const rclcpp::NodeOptions & options)
Expand Down Expand Up @@ -48,4 +48,4 @@ auto EmergencyStop::on_joy_received(
rclcpp::shutdown();
}
}
} // namespace carma_nav2_emergency_stop
} // namespace nav2_emergency_stop
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <carma_nav2_emergency_stop/emergency_stop.hpp>
#include <nav2_emergency_stop/emergency_stop.hpp>
#include <rclcpp/rclcpp.hpp>

auto main(int argc, char * argv[]) -> int
{
rclcpp::init(argc, argv);

auto node{std::make_shared<carma_nav2_emergency_stop::EmergencyStop>(rclcpp::NodeOptions{})};
auto node{std::make_shared<nav2_emergency_stop::EmergencyStop>(rclcpp::NodeOptions{})};

rclcpp::executors::SingleThreadedExecutor executor;
executor.add_node(node->get_node_base_interface());
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.22)
project(carma_nav2_port_drayage_demo)
project(nav2_port_drayage_demo)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
Expand All @@ -8,16 +8,16 @@ include_directories(
include/
)

ament_auto_add_library(carma_nav2_port_drayage_demo
ament_auto_add_library(nav2_port_drayage_demo
src/port_drayage_demo.cpp
)

ament_auto_add_executable(carma_nav2_port_drayage_demo_node
ament_auto_add_executable(nav2_port_drayage_demo_node
src/port_drayage_demo_node.cpp
)

target_link_libraries(carma_nav2_port_drayage_demo_node
carma_nav2_port_drayage_demo
target_link_libraries(nav2_port_drayage_demo_node
nav2_port_drayage_demo
)

# Testing
Expand All @@ -28,7 +28,7 @@ if(BUILD_TESTING)

ament_add_gtest(test_port_drayage_demo test/test_port_drayage_demo.cpp)

target_link_libraries(test_port_drayage_demo carma_nav2_port_drayage_demo)
target_link_libraries(test_port_drayage_demo nav2_port_drayage_demo)

endif()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `carma_nav2_port_drayage_demo` package
# `nav2_port_drayage_demo` package

This package integrates Port Drayage operations with a Nav2-based autonomy stack. The package's node listens for
incoming port drayage messages of type `carma_v2x_msgs/msg/MobilityOperation` and then sends the target location to the Nav2 Waypoint
Expand Down Expand Up @@ -51,7 +51,7 @@ For the purpose of this demo, the only necessary fields to populate when sending
```


For example, to send a Mobility Operation Message instructing the Turtlebot to pick up cargo with the ID "`C1T_CARGO`" at `(x,y)` coordinates `(3.8, 0.5)` using the ROS2 CLI, run the command:
For example, to send a Mobility Operation Message instructing the Turtlebot to pick up cargo with the ID "`CARGO_A`" at `(x,y)` coordinates `(3.8, 0.5)` using the ROS2 CLI, run the command:

```
ros2 topic pub --once /incoming_mobility_operation carma_v2x_msgs/msg/MobilityOperation "m_header:
Expand All @@ -61,12 +61,12 @@ ros2 topic pub --once /incoming_mobility_operation carma_v2x_msgs/msg/MobilityOp
plan_id: ''
timestamp: 0
strategy: 'carma/port_drayage'
strategy_params: '{\"cmv_id\":\"turtlebot\",\"operation\":\"PICKUP\",\"cargo\":false,\"cargo_id\":\"C1T_CARGO\",\"destination\":{\"longitude\":3.8,\"latitude\":0.5},\"action_id\":\"PORT_DRAYAGE\"}'"
strategy_params: '{\"cmv_id\":\"turtlebot\",\"operation\":\"PICKUP\",\"cargo\":false,\"cargo_id\":\"CARGO_A\",\"destination\":{\"longitude\":3.8,\"latitude\":0.5},\"action_id\":\"PORT_DRAYAGE\"}'"
```

## Turtlebot Gazebo Launch Instructions

To run the Port Drayage demo using the Turtlebot in the Gazebo simulator, first follow the [c1t_bringup Prerequisites](https://github.com/usdot-fhwa-stol/c1t_bringup?tab=readme-ov-file#prerequisites) to download and build the necessary software.
To run the Port Drayage demo using the Turtlebot in the Gazebo simulator, first follow the [cda1tenth_bringup Prerequisites](https://github.com/usdot-fhwa-stol/cda1tenth_bringup?tab=readme-ov-file#prerequisites) to download and build the necessary software.

Then, download and run the simulation environment using:

Expand All @@ -77,14 +77,14 @@ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py

To launch the Port Drayage demo, run
```
ros2 launch c1t_bringup c1t_bringup_launch.xml vehicle:=turtlebot
ros2 launch cda1tenth_bringup cda1tenth_bringup_launch.xml vehicle:=turtlebot
```

Next, provide the Turtlebot with an initial pose estimate using the 2D Pose Estimate arrow in Rviz. Once the vehicle has localized, it is now ready to
receive a Mobility Operation message to determine an action to complete. To start a simple demonstration of the Turtlebot picking up and dropping off cargo, run:

```
cd carma_nav2_port_drayage_demo/
cd nav2_port_drayage_demo/
./test/turtlebot_port_drayage_test.sh
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef CARMA_NAV2_PORT_DRAYAGE_DEMO__PORT_DRAYAGE_DEMO_HPP_
#define CARMA_NAV2_PORT_DRAYAGE_DEMO__PORT_DRAYAGE_DEMO_HPP_
#ifndef NAV2_PORT_DRAYAGE_DEMO__PORT_DRAYAGE_DEMO_HPP_
#define NAV2_PORT_DRAYAGE_DEMO__PORT_DRAYAGE_DEMO_HPP_

#include <carma_v2x_msgs/msg/mobility_operation.hpp>
#include <geometry_msgs/msg/pose_with_covariance_stamped.hpp>
Expand All @@ -28,7 +28,7 @@
#include <rclcpp_lifecycle/lifecycle_node.hpp>
#include <string>

namespace carma_nav2_port_drayage_demo
namespace nav2_port_drayage_demo
{

class OperationID
Expand Down Expand Up @@ -110,10 +110,10 @@ struct PortDrayageMobilityOperationMsg
std::string cargo_id;
std::shared_ptr<OperationID> operation;
std::string current_action_id; // Identifier for the action this message is related to
double dest_longitude; // Destination longitude for the carma vehicle
double dest_latitude; // Destination latitude for the carma vehicle
double start_longitude; // Starting longitude of the carma vehicle
double start_latitude; // Starting latitude of the carma vehicle
double dest_longitude; // Destination longitude for the CDA1Tenth vehicle
double dest_latitude; // Destination latitude for the CDA1Tenth vehicle
double start_longitude; // Starting longitude of the CDA1Tenth vehicle
double start_latitude; // Starting latitude of the CDA1Tenth vehicle
PortDrayageMobilityOperationMsg()
{
operation =
Expand Down Expand Up @@ -227,6 +227,6 @@ class PortDrayageDemo : public rclcpp_lifecycle::LifecycleNode
// Previously received Mobility Operation message
PortDrayageMobilityOperationMsg previous_mobility_operation_msg_;
};
} // namespace carma_nav2_port_drayage_demo
} // namespace nav2_port_drayage_demo

#endif // CARMA_NAV2_PORT_DRAYAGE_DEMO__PORT_DRAYAGE_DEMO_HPP_
#endif // NAV2_PORT_DRAYAGE_DEMO__PORT_DRAYAGE_DEMO_HPP_
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>carma_nav2_port_drayage_demo</name>
<name>nav2_port_drayage_demo</name>
<version>0.1.0</version>
<description>A port drayage demo navigation2 application</description>
<maintainer email="carma@dot.gov">CARMA Support</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "carma_nav2_port_drayage_demo/port_drayage_demo.hpp"
#include "nav2_port_drayage_demo/port_drayage_demo.hpp"

namespace carma_nav2_port_drayage_demo
namespace nav2_port_drayage_demo
{

OperationID::OperationID(std::string op_str) : operation_enum_(stringToOperation(op_str)) {}
Expand Down Expand Up @@ -278,4 +278,4 @@ auto PortDrayageDemo::compose_arrival_message() -> carma_v2x_msgs::msg::Mobility
result.strategy_params = mobility_operation_json.dump();
return result;
}
} // namespace carma_nav2_port_drayage_demo
} // namespace nav2_port_drayage_demo
Loading

0 comments on commit 174086e

Please sign in to comment.