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

Arc 258 more humble #2475

Merged
merged 10 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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/workflows/humble-upgraded-packages.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
approximate_intersection carma motion_prediction_visualizer system_controller object_visualizer mock_controller_driver object_detection_tracking gnss_to_map_convertor mobilitypath_visualizer bsm_generator trajectory_visualizer trajectory_executor lightbar_manager mobilitypath_publisher guidance port_drayage_plugin subsystem_controllers carma_wm roadway_objects basic_autonomy carma_guidance_plugins plan_delegator traffic_incident_parser platooning_tactical_plugin intersection_transit_maneuvering light_controlled_intersection_tactical_plugin stop_and_dwell_strategic_plugin cooperative_lanechange lci_strategic_plugin stop_controlled_intersection_tactical_plugin sci_strategic_plugin inlanecruising_plugin platooning_control trajectory_follower_wrapper approaching_emergency_vehicle_plugin yield_plugin
approximate_intersection carma motion_prediction_visualizer system_controller object_visualizer mock_controller_driver object_detection_tracking gnss_to_map_convertor mobilitypath_visualizer bsm_generator trajectory_visualizer trajectory_executor lightbar_manager mobilitypath_publisher guidance port_drayage_plugin subsystem_controllers carma_wm roadway_objects basic_autonomy carma_guidance_plugins plan_delegator traffic_incident_parser platooning_tactical_plugin intersection_transit_maneuvering light_controlled_intersection_tactical_plugin stop_and_dwell_strategic_plugin cooperative_lanechange lci_strategic_plugin stop_controlled_intersection_tactical_plugin sci_strategic_plugin inlanecruising_plugin platooning_control trajectory_follower_wrapper approaching_emergency_vehicle_plugin yield_plugin arbitrator carma_cloud_client carma_cooperative_perception carma_wm_ctrl frame_transformer pure_pursuit_wrapper stop_and_wait_plugin
5 changes: 3 additions & 2 deletions arbitrator/include/arbitrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <geometry_msgs/msg/twist_stamped.hpp>
#include <tf2_ros/transform_listener.h>
#include <tf2_ros/buffer.h>
#include <tf2/LinearMath/Transform.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>

#include "vehicle_state.hpp"
#include "arbitrator_state_machine.hpp"
Expand Down Expand Up @@ -64,7 +65,7 @@ namespace arbitrator
sm_(sm),
nh_(nh),
min_plan_duration_(min_plan_duration),
time_between_plans_(planning_period),
time_between_plans_(rclcpp::Duration::from_seconds(planning_period)),
capabilities_interface_(ci),
planning_strategy_(planning_strategy),
initialized_(false),
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/include/capabilities_interface.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace arbitrator
continue;
}

const auto response = client->async_send_request(msg);
auto response = client->async_send_request(msg);

switch (const auto status{response.wait_for(500ms)}) {
case std::future_status::ready:
Expand Down
1 change: 1 addition & 0 deletions arbitrator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<depend>carma_wm</depend>
<depend>tf</depend>
<depend>tf2</depend>
<depend>tf2_ros</depend>
<depend>tf2_geometry_msgs</depend>
<depend>rapidjson</depend>

Expand Down
4 changes: 2 additions & 2 deletions arbitrator/src/arbitrator_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace arbitrator
auto bss = std::make_shared<arbitrator::BeamSearchStrategy>(config_.beam_width);

auto png = std::make_shared<arbitrator::PluginNeighborGenerator<arbitrator::CapabilitiesInterface>>(ci);
arbitrator::TreePlanner tp(cf, png, bss, rclcpp::Duration(config_.target_plan_duration* 1e9));
arbitrator::TreePlanner tp(cf, png, bss, rclcpp::Duration::from_nanoseconds(config_.target_plan_duration* 1e9));

wm_listener_ = std::make_shared<carma_wm::WMListener>(
this->get_node_base_interface(), this->get_node_logging_interface(),
Expand All @@ -81,7 +81,7 @@ namespace arbitrator
std::make_shared<ArbitratorStateMachine>(sm),
ci,
std::make_shared<TreePlanner>(tp),
rclcpp::Duration(config_.min_plan_duration* 1e9),
rclcpp::Duration::from_nanoseconds(config_.min_plan_duration* 1e9),
1/config_.planning_frequency,
wm_ );

Expand Down
2 changes: 1 addition & 1 deletion arbitrator/src/tree_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace arbitrator
open_list_to_evaluate.push_back(std::make_pair(root, INF));

carma_planning_msgs::msg::ManeuverPlan longest_plan = root; // Track longest plan in case target length is never reached
rclcpp::Duration longest_plan_duration = rclcpp::Duration(0);
rclcpp::Duration longest_plan_duration = rclcpp::Duration::from_nanoseconds(0);


while (!open_list_to_evaluate.empty())
Expand Down
1 change: 1 addition & 0 deletions carma_cloud_client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<depend>j2735_v2x_msgs</depend>
<depend>carma_v2x_msgs</depend>
<depend>j2735_convertor</depend>
<depend>std_srvs</depend>

<!-- <depend>qhttpengine</depend> -->
<!-- <depend>v2xhubWebAPI</depend> -->
Expand Down
10 changes: 2 additions & 8 deletions carma_cooperative_perception/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ carma_check_ros_version(2)
# `dependencies.cmake`.
find_package(ament_cmake_auto REQUIRED)

# Needed so CMake can find the vendored PROJ4 module file. Th FindPROJ4.cmake
# module file can be removed if we upgrade to a more recent PROJ version. See
# https://github.com/usdot-fhwa-stol/carma-platform/issues/2139 for updates.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

include(cmake_options.cmake)
include(dependencies.cmake)

Expand All @@ -48,8 +43,7 @@ file(TOUCH ${PROJECT_BINARY_DIR}/COLCON_IGNORE)
# Configures CARMA package default settings
carma_package()

# C17 CMake support added in CMake 3.21
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 11)

# This will automatically add include files from include/carma_cooperative_perception
Expand All @@ -69,7 +63,7 @@ ament_auto_add_library(carma_cooperative_perception SHARED
)

target_link_libraries(carma_cooperative_perception
${PROJ4_LIBRARIES} # Note: Newer versions of PROJ use PROJ::proj
${PROJ_LIBRARIES}
GSL # Note: Newer versions of GSL use Microsoft.GSL::GSL
units::units
multiple_object_tracking::multiple_object_tracking
Expand Down
91 changes: 91 additions & 0 deletions carma_cooperative_perception/cmake/FindPROJ.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file COPYING-CMAKE-SCRIPTS or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindPROJ
Copy link
Contributor

@MishkaMN MishkaMN Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this since we added the FindPROJ in cmake? It looks like it built without it anyways. So we should delete the cmake folder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it looks like FindPROJ.cmake is not actually needed so I removed it. The rest of the cmake folder is still in use though

---------

CMake module to search for PROJ(PROJ.4 and PROJ) library

On success, the macro sets the following variables:
``PROJ_FOUND``
if the library found

``PROJ_LIBRARIES``
full path to the library

``PROJ_INCLUDE_DIRS``
where to find the library headers

``PROJ_VERSION_STRING``
version string of PROJ

Copyright (c) 2009 Mateusz Loskot <[email protected]>
Copyright (c) 2015 NextGIS <[email protected]>
Copyright (c) 2018 Hiroshi Miura

#]=======================================================================]

find_path(PROJ_INCLUDE_DIR proj.h
PATHS ${PROJ_ROOT}/include
DOC "Path to PROJ library include directory")

set(PROJ_NAMES ${PROJ_NAMES} proj proj_i)
set(PROJ_NAMES_DEBUG ${PROJ_NAMES_DEBUG} projd proj_d)

if(NOT PROJ_LIBRARY)
find_library(PROJ_LIBRARY_RELEASE NAMES ${PROJ_NAMES})
find_library(PROJ_LIBRARY_DEBUG NAMES ${PROJ_NAMES_DEBUG})
include(SelectLibraryConfigurations)
select_library_configurations(PROJ)
mark_as_advanced(PROJ_LIBRARY_RELEASE PROJ_LIBRARY_DEBUG)
endif()

unset(PROJ_NAMES)
unset(PROJ_NAMES_DEBUG)

if(PROJ_INCLUDE_DIR)
file(READ "${PROJ_INCLUDE_DIR}/proj.h" PROJ_H_CONTENTS)
string(REGEX REPLACE "^.*PROJ_VERSION_MAJOR +([0-9]+).*$" "\\1" PROJ_VERSION_MAJOR "${PROJ_H_CONTENTS}")
string(REGEX REPLACE "^.*PROJ_VERSION_MINOR +([0-9]+).*$" "\\1" PROJ_VERSION_MINOR "${PROJ_H_CONTENTS}")
string(REGEX REPLACE "^.*PROJ_VERSION_PATCH +([0-9]+).*$" "\\1" PROJ_VERSION_PATCH "${PROJ_H_CONTENTS}")
unset(PROJ_H_CONTENTS)
set(PROJ_VERSION_STRING "${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}.${PROJ_VERSION_PATCH}")
endif ()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PROJ
REQUIRED_VARS PROJ_LIBRARY PROJ_INCLUDE_DIR
VERSION_VAR PROJ_VERSION_STRING)
mark_as_advanced(PROJ_INCLUDE_DIR PROJ_LIBRARY)

if(PROJ_FOUND)
set(PROJ_LIBRARIES "${PROJ_LIBRARY}")
set(PROJ_INCLUDE_DIRS "${PROJ_INCLUDE_DIR}")
if(NOT TARGET PROJ::proj)
add_library(PROJ::proj UNKNOWN IMPORTED)
set_target_properties(PROJ::proj PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PROJ_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C")
if(EXISTS "${PROJ_LIBRARY}")
set_target_properties(PROJ::proj PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${PROJ_LIBRARY}")
endif()
if(EXISTS "${PROJ_LIBRARY_RELEASE}")
set_property(TARGET PROJ::proj APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(PROJ::proj PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${PROJ_LIBRARY_RELEASE}")
endif()
if(EXISTS "${PROJ_LIBRARY_DEBUG}")
set_property(TARGET PROJ::proj APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(PROJ::proj PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
IMPORTED_LOCATION_DEBUG "${PROJ_LIBRARY_DEBUG}")
endif()
endif()
endif()

91 changes: 0 additions & 91 deletions carma_cooperative_perception/cmake/FindPROJ4.cmake

This file was deleted.

8 changes: 1 addition & 7 deletions carma_cooperative_perception/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ CPMAddPackage(NAME units

find_package(multiple_object_tracking REQUIRED)

# CARMA currently uses PROJ version 6.3.1, which is not designed to be incorporated
# as a subdirectory into larger projects. If CARMA upgrades to a newer version, we
# could use the CPMAddPackage(...) command to install PROJ as a source dependency
# if there is no version already locally available.
# See https://github.com/usdot-fhwa-stol/carma-platform/issues/2139 for the PROJ
# version upgrade plans.
find_package(PROJ4 REQUIRED MODULE)
find_package(PROJ REQUIRED MODULE)

# lint_cmake: -readability/wonkycase
CPMAddPackage(NAME Microsoft.GSL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DetectionListVizNode::DetectionListVizNode(const rclcpp::NodeOptions & options)
[this](carma_cooperative_perception_interfaces::msg::DetectionList::ConstSharedPtr msg_ptr) {
visualization_msgs::msg::MarkerArray markers;

for (const auto detection : msg_ptr->detections) {
for (const auto& detection : msg_ptr->detections) {
visualization_msgs::msg::Marker marker;

marker.header = detection.header;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ auto HostVehicleFilterNode::handle_on_configure(

RCLCPP_ERROR(
get_logger(),
"Cannot change parameter 'distance_threshold_meters': " + result.reason);
("Cannot change parameter 'distance_threshold_meters': " + result.reason).c_str());

break;
}
Expand All @@ -86,7 +86,7 @@ auto HostVehicleFilterNode::handle_on_configure(

RCLCPP_ERROR(
get_logger(),
"Cannot change parameter 'distance_threshold_meters': " + result.reason);
("Cannot change parameter 'distance_threshold_meters': " + result.reason).c_str());

break;
} else {
Expand Down
2 changes: 1 addition & 1 deletion carma_cooperative_perception/src/msg_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "carma_cooperative_perception/msg_conversion.hpp"

#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <carma_cooperative_perception_interfaces/msg/track.hpp>
#include <carma_cooperative_perception_interfaces/msg/track_list.hpp>
#include <carma_perception_msgs/msg/external_object.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "carma_cooperative_perception/multiple_object_tracker_component.hpp"

#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <units.h>
#include <rclcpp/rclcpp.hpp>
#include <rclcpp_components/register_node_macro.hpp>
Expand Down Expand Up @@ -283,7 +283,7 @@ auto MultipleObjectTrackerNode::handle_on_configure(
result.reason = "parameter is read-only while node is in 'Active' state";

RCLCPP_ERROR(
get_logger(), "Cannot change parameter 'execution_frequency_hz': " + result.reason);
get_logger(), ("Cannot change parameter 'execution_frequency_hz': " + result.reason).c_str());

break;
} else {
Expand All @@ -295,7 +295,7 @@ auto MultipleObjectTrackerNode::handle_on_configure(
result.reason = "parameter is read-only while node is in 'Active' state";

RCLCPP_ERROR(
get_logger(), "Cannot change parameter 'execution_frequency_hz': " + result.reason);
get_logger(), ("Cannot change parameter 'execution_frequency_hz': " + result.reason).c_str());

break;
} else {
Expand All @@ -313,7 +313,7 @@ auto MultipleObjectTrackerNode::handle_on_configure(
result.reason = "parameter is read-only while node is in 'Active' state";

RCLCPP_ERROR(
get_logger(), "Cannot change parameter 'execution_frequency_hz': " + result.reason);
get_logger(), ("Cannot change parameter 'execution_frequency_hz': " + result.reason).c_str());

break;
} else {
Expand Down
3 changes: 2 additions & 1 deletion carma_wm/include/carma_wm/WorldModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <exception>
#include <memory>
#include <tuple>
#include <optional>
#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_core/primitives/Area.h>
#include <lanelet2_core/primitives/Lanelet.h>
Expand Down Expand Up @@ -450,4 +451,4 @@ class WorldModel
};
// Helpful using declarations for carma_wm classes
using WorldModelConstPtr = std::shared_ptr<const WorldModel>;
} // namespace carma_wm
} // namespace carma_wm
Loading
Loading