Skip to content

Commit

Permalink
Merge branch 'master' into fix/pass_despawn_function_in_constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hakuturu583 authored Jan 9, 2025
2 parents dfe8613 + fe43275 commit 464f163
Show file tree
Hide file tree
Showing 71 changed files with 559 additions and 364 deletions.
8 changes: 8 additions & 0 deletions common/math/arithmetic/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Changelog for package arithmetic
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

7.4.4 (2025-01-09)
------------------
* Merge branch 'master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Contributors: Tatsuya Yamasaki, yamacir-kit

7.4.3 (2025-01-07)
------------------
* Merge branch 'master' into tmp/pc-patch
Expand Down
2 changes: 1 addition & 1 deletion common/math/arithmetic/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>arithmetic</name>
<version>7.4.3</version>
<version>7.4.4</version>
<description>arithmetic library for scenario_simulator_v2</description>
<maintainer email="[email protected]">Tatsuya Yamasaki</maintainer>
<license>Apache License 2.0</license>
Expand Down
8 changes: 8 additions & 0 deletions common/math/geometry/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Changelog for package geometry
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

7.4.4 (2025-01-09)
------------------
* Merge branch 'master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Contributors: Tatsuya Yamasaki, yamacir-kit

7.4.3 (2025-01-07)
------------------
* Merge branch 'master' into tmp/pc-patch
Expand Down
2 changes: 1 addition & 1 deletion common/math/geometry/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>geometry</name>
<version>7.4.3</version>
<version>7.4.4</version>
<description>geometry math library for scenario_simulator_v2 application</description>
<maintainer email="[email protected]">Masaya Kataoka</maintainer>
<license>Apache License 2.0</license>
Expand Down
8 changes: 8 additions & 0 deletions common/scenario_simulator_exception/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Changelog for package scenario_simulator_exception
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

7.4.4 (2025-01-09)
------------------
* Merge branch 'master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Contributors: Tatsuya Yamasaki, yamacir-kit

7.4.3 (2025-01-07)
------------------
* Merge branch 'master' into tmp/pc-patch
Expand Down
2 changes: 1 addition & 1 deletion common/scenario_simulator_exception/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>scenario_simulator_exception</name>
<version>7.4.3</version>
<version>7.4.4</version>
<description>Exception types for scenario simulator</description>
<maintainer email="[email protected]">Tatsuya Yamasaki</maintainer>
<license>Apache License 2.0</license>
Expand Down
8 changes: 8 additions & 0 deletions common/simple_junit/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Changelog for package junit_exporter
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

7.4.4 (2025-01-09)
------------------
* Merge branch 'master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Contributors: Tatsuya Yamasaki, yamacir-kit

7.4.3 (2025-01-07)
------------------
* Merge branch 'master' into tmp/pc-patch
Expand Down
2 changes: 1 addition & 1 deletion common/simple_junit/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>simple_junit</name>
<version>7.4.3</version>
<version>7.4.4</version>
<description>Lightweight JUnit library for ROS 2</description>
<maintainer email="[email protected]">Masaya Kataoka</maintainer>
<maintainer email="[email protected]">Tatsuya Yamasaki</maintainer>
Expand Down
8 changes: 8 additions & 0 deletions common/status_monitor/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Changelog for package status_monitor
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

7.4.4 (2025-01-09)
------------------
* Merge branch 'master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Contributors: Tatsuya Yamasaki, yamacir-kit

7.4.3 (2025-01-07)
------------------
* Merge branch 'master' into tmp/pc-patch
Expand Down
2 changes: 1 addition & 1 deletion common/status_monitor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>status_monitor</name>
<version>7.4.3</version>
<version>7.4.4</version>
<description>none</description>
<maintainer email="[email protected]">Tatsuya Yamasaki</maintainer>
<license>Apache License 2.0</license>
Expand Down
23 changes: 23 additions & 0 deletions external/concealer/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@ Changelog for package concealer
* Merge remote-tracking branch 'origin/master' into feature/publish_empty_context
* Contributors: Masaya Kataoka

7.4.4 (2025-01-09)
------------------
* Merge pull request `#1497 <https://github.com/tier4/scenario_simulator_v2/issues/1497>`_ from tier4/refactor/concealer-2
Refactor/concealer 2
* Merge branch 'master' into refactor/concealer-2
* Cleanup member function `FieldOperatorApplication::sendCooperateCommand`
* Move function `isValidCooperateStatus` into `sendCooperateCommand`
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Remove some member accessor from struct `FieldOperatorApplication`
* Remove member function `FieldOperatorApplication::getAutowareStateName`
* Remove data member `FieldOperatorApplication::latest_cooperate_status_array`
* Remove member function `AutowareUniverse::updateVehicleState`
* Remove member function `AutowareUniverse::updateLocalization`
* Cleanup `ControlModeCommand` service callback
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Merge remote-tracking branch 'origin/master' into refactor/concealer-2
* Remove static member function `EgoEntity::makeFieldOperatorApplication`
* Rename class `ServiceWithValidation` to `Service`
* Rename class `SubscriberWrapper` to `Subscriber`
* Lipsticks
* Rename class `PublisherWrapper` to `Publisher`
* Contributors: Tatsuya Yamasaki, yamacir-kit

7.4.3 (2025-01-07)
------------------
* Merge branch 'master' into tmp/pc-patch
Expand Down
34 changes: 15 additions & 19 deletions external/concealer/include/concealer/autoware_universe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <autoware_vehicle_msgs/msg/velocity_report.hpp>
#include <autoware_vehicle_msgs/srv/control_mode_command.hpp>
#include <concealer/continuous_transform_broadcaster.hpp>
#include <concealer/publisher_wrapper.hpp>
#include <concealer/subscriber_wrapper.hpp>
#include <concealer/publisher.hpp>
#include <concealer/subscriber.hpp>
#include <concealer/visibility.hpp>
#include <geometry_msgs/msg/accel_with_covariance_stamped.hpp>
#include <geometry_msgs/msg/pose.hpp>
Expand Down Expand Up @@ -57,19 +57,19 @@ class AutowareUniverse : public rclcpp::Node,
using TurnIndicatorsReport = autoware_vehicle_msgs::msg::TurnIndicatorsReport;
using VelocityReport = autoware_vehicle_msgs::msg::VelocityReport;

SubscriberWrapper<Control> getCommand;
SubscriberWrapper<GearCommand> getGearCommand;
SubscriberWrapper<TurnIndicatorsCommand> getTurnIndicatorsCommand;
SubscriberWrapper<PathWithLaneId> getPathWithLaneId;
Subscriber<Control> getCommand;
Subscriber<GearCommand> getGearCommand;
Subscriber<TurnIndicatorsCommand> getTurnIndicatorsCommand;
Subscriber<PathWithLaneId> getPathWithLaneId;

PublisherWrapper<AccelWithCovarianceStamped> setAcceleration;
PublisherWrapper<Odometry> setOdometry;
PublisherWrapper<PoseWithCovarianceStamped> setPose;
PublisherWrapper<SteeringReport> setSteeringReport;
PublisherWrapper<GearReport> setGearReport;
PublisherWrapper<ControlModeReport> setControlModeReport;
PublisherWrapper<VelocityReport> setVelocityReport;
PublisherWrapper<TurnIndicatorsReport> setTurnIndicatorsReport;
Publisher<AccelWithCovarianceStamped> setAcceleration;
Publisher<Odometry> setOdometry;
Publisher<PoseWithCovarianceStamped> setPose;
Publisher<SteeringReport> setSteeringReport;
Publisher<GearReport> setGearReport;
Publisher<ControlModeReport> setControlModeReport;
Publisher<VelocityReport> setVelocityReport;
Publisher<TurnIndicatorsReport> setTurnIndicatorsReport;

std::atomic<geometry_msgs::msg::Accel> current_acceleration;
std::atomic<geometry_msgs::msg::Pose> current_pose;
Expand All @@ -83,7 +83,7 @@ class AutowareUniverse : public rclcpp::Node,

const rclcpp::TimerBase::SharedPtr vehicle_state_update_timer;

std::thread localization_and_vehicle_state_update_thread;
std::thread spinner;

std::atomic<bool> is_stop_requested = false;

Expand All @@ -100,10 +100,6 @@ class AutowareUniverse : public rclcpp::Node,

auto rethrow() -> void;

auto updateLocalization() -> void;

auto updateVehicleState() -> void;

auto getVehicleCommand() const -> std::tuple<double, double, double, double, int>;

auto getRouteLanelets() const -> std::vector<std::int64_t>;
Expand Down
80 changes: 24 additions & 56 deletions external/concealer/include/concealer/field_operator_application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
#include <autoware_vehicle_msgs/msg/gear_command.hpp>
#include <autoware_vehicle_msgs/msg/turn_indicators_command.hpp>
#include <concealer/autoware_universe.hpp>
#include <concealer/launch.hpp>
#include <concealer/publisher_wrapper.hpp>
#include <concealer/service_with_validation.hpp>
#include <concealer/subscriber_wrapper.hpp>
#include <concealer/publisher.hpp>
#include <concealer/service.hpp>
#include <concealer/subscriber.hpp>
#include <concealer/task_queue.hpp>
#include <concealer/transition_assertion.hpp>
#include <concealer/visibility.hpp>
Expand All @@ -55,19 +54,6 @@

namespace concealer
{
/* ---- NOTE -------------------------------------------------------------------
*
* The magic class 'FieldOperatorApplication' is a class that makes it easy to work with
* Autoware from C++. The main features of this class are as follows
*
* (1) Launch Autoware in an independent process upon instantiation of the
* class.
* (2) Properly terminates the Autoware process started by the constructor
* upon destruction of the class.
* (3) Probably the simplest instructions to Autoware, consisting of
* initialize, plan, and engage.
*
* -------------------------------------------------------------------------- */
struct FieldOperatorApplication : public rclcpp::Node,
public TransitionAssertion<FieldOperatorApplication>
{
Expand All @@ -77,11 +63,9 @@ struct FieldOperatorApplication : public rclcpp::Node,

const pid_t process_id = 0;

bool initialize_was_called = false;
bool initialized = false;

std::string autoware_state;

tier4_rtc_msgs::msg::CooperateStatusArray latest_cooperate_status_array;
std::string autoware_state = "LAUNCHING";

std::string minimum_risk_maneuver_state;

Expand All @@ -107,26 +91,26 @@ struct FieldOperatorApplication : public rclcpp::Node,
using SetVelocityLimit = tier4_external_api_msgs::srv::SetVelocityLimit;
using ChangeOperationMode = autoware_adapi_v1_msgs::srv::ChangeOperationMode;

SubscriberWrapper<AutowareState> getAutowareState;
SubscriberWrapper<Control> getCommand;
SubscriberWrapper<CooperateStatusArray> getCooperateStatusArray;
SubscriberWrapper<Emergency> getEmergencyState;
Subscriber<AutowareState> getAutowareState;
Subscriber<Control> getCommand;
Subscriber<CooperateStatusArray> getCooperateStatusArray;
Subscriber<Emergency> getEmergencyState;
#if __has_include(<autoware_adapi_v1_msgs/msg/localization_initialization_state.hpp>)
SubscriberWrapper<LocalizationInitializationState> getLocalizationState;
Subscriber<LocalizationInitializationState> getLocalizationState;
#endif
SubscriberWrapper<MrmState> getMrmState;
SubscriberWrapper<PathWithLaneId> getPathWithLaneId;
SubscriberWrapper<Trajectory> getTrajectory;
SubscriberWrapper<TurnIndicatorsCommand> getTurnIndicatorsCommand;

ServiceWithValidation<ClearRoute> requestClearRoute;
ServiceWithValidation<CooperateCommands> requestCooperateCommands;
ServiceWithValidation<Engage> requestEngage;
ServiceWithValidation<InitializeLocalization> requestInitialPose;
ServiceWithValidation<SetRoutePoints> requestSetRoutePoints;
ServiceWithValidation<AutoModeWithModule> requestSetRtcAutoMode;
ServiceWithValidation<SetVelocityLimit> requestSetVelocityLimit;
ServiceWithValidation<ChangeOperationMode> requestEnableAutowareControl;
Subscriber<MrmState> getMrmState;
Subscriber<PathWithLaneId> getPathWithLaneId;
Subscriber<Trajectory> getTrajectory;
Subscriber<TurnIndicatorsCommand> getTurnIndicatorsCommand;

Service<ClearRoute> requestClearRoute;
Service<CooperateCommands> requestCooperateCommands;
Service<Engage> requestEngage;
Service<InitializeLocalization> requestInitialPose;
Service<SetRoutePoints> requestSetRoutePoints;
Service<AutoModeWithModule> requestSetRtcAutoMode;
Service<SetVelocityLimit> requestSetVelocityLimit;
Service<ChangeOperationMode> requestEnableAutowareControl;
// clang-format on

/*
Expand All @@ -136,13 +120,7 @@ struct FieldOperatorApplication : public rclcpp::Node,
*/
TaskQueue task_queue;

CONCEALER_PUBLIC explicit FieldOperatorApplication(const pid_t = 0);

template <typename... Ts>
CONCEALER_PUBLIC explicit FieldOperatorApplication(Ts &&... xs)
: FieldOperatorApplication(ros2_launch(std::forward<decltype(xs)>(xs)...))
{
}
CONCEALER_PUBLIC explicit FieldOperatorApplication(const pid_t);

~FieldOperatorApplication();

Expand All @@ -160,18 +138,8 @@ struct FieldOperatorApplication : public rclcpp::Node,

auto clearRoute() -> void;

auto getAutowareStateName() const { return autoware_state; }

auto getMinimumRiskManeuverBehaviorName() const { return minimum_risk_maneuver_behavior; }

auto getMinimumRiskManeuverStateName() const { return minimum_risk_maneuver_state; }

auto getEmergencyStateName() const { return minimum_risk_maneuver_state; }

auto getWaypoints() const -> traffic_simulator_msgs::msg::WaypointsArray;

auto initialized() const noexcept { return initialize_was_called; }

auto requestAutoModeForCooperation(const std::string &, bool) -> void;

auto rethrow() const { task_queue.rethrow(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,32 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef CONCEALER__PUBLISHER_WRAPPER_HPP_
#define CONCEALER__PUBLISHER_WRAPPER_HPP_
#ifndef CONCEALER__PUBLISHER_HPP_
#define CONCEALER__PUBLISHER_HPP_

#include <memory>
#include <rclcpp/rclcpp.hpp>

namespace concealer
{
template <typename MessageType>
class PublisherWrapper
template <typename Message>
class Publisher
{
private:
typename rclcpp::Publisher<MessageType>::SharedPtr publisher;
typename rclcpp::Publisher<Message>::SharedPtr publisher;

public:
auto operator()(const MessageType & message) const -> decltype(auto)
template <typename Node>
explicit Publisher(const std::string & topic, Node & node)
: publisher(node.template create_publisher<Message>(topic, rclcpp::QoS(1).reliable()))
{
return publisher->publish(message);
}

template <typename NodeInterface>
explicit PublisherWrapper(std::string topic, NodeInterface & autoware_interface)
: publisher(
autoware_interface.template create_publisher<MessageType>(topic, rclcpp::QoS(1).reliable()))
template <typename... Ts>
auto operator()(Ts &&... xs) const -> decltype(auto)
{
return publisher->publish(std::forward<decltype(xs)>(xs)...);
}
};
} // namespace concealer

#endif // CONCEALER__PUBLISHER_WRAPPER_HPP_
#endif // CONCEALER__PUBLISHER_HPP_
Loading

0 comments on commit 464f163

Please sign in to comment.