39
39
40
40
namespace reaction_analyzer ::subscriber
41
41
{
42
- using autoware_auto_control_msgs::msg::AckermannControlCommand;
43
- using autoware_auto_perception_msgs::msg::DetectedObject;
44
- using autoware_auto_perception_msgs::msg::DetectedObjects;
45
- using autoware_auto_perception_msgs::msg::PredictedObject;
46
- using autoware_auto_perception_msgs::msg::PredictedObjects;
47
- using autoware_auto_perception_msgs::msg::TrackedObject;
48
- using autoware_auto_perception_msgs::msg::TrackedObjects;
49
- using autoware_auto_planning_msgs::msg::Trajectory;
42
+ using autoware_control_msgs::msg::Control;
50
43
using autoware_internal_msgs::msg::PublishedTime;
44
+ using autoware_perception_msgs::msg::DetectedObject;
45
+ using autoware_perception_msgs::msg::DetectedObjects;
46
+ using autoware_perception_msgs::msg::PredictedObject;
47
+ using autoware_perception_msgs::msg::PredictedObjects;
48
+ using autoware_perception_msgs::msg::TrackedObject;
49
+ using autoware_perception_msgs::msg::TrackedObjects;
50
+ using autoware_planning_msgs::msg::Trajectory;
51
51
using geometry_msgs::msg::Pose;
52
52
using nav_msgs::msg::Odometry;
53
53
using sensor_msgs::msg::PointCloud2;
54
54
55
55
// Buffers to be used to store subscribed messages' data, pipeline Header, and PublishedTime
56
56
using MessageBuffer = std::optional<PublishedTime>;
57
- // We need to store the past AckermannControlCommands to analyze the first brake
58
- using ControlCommandBuffer = std::pair<std::vector<AckermannControlCommand >, MessageBuffer>;
57
+ // We need to store the past Control to analyze the first brake
58
+ using ControlCommandBuffer = std::pair<std::vector<Control >, MessageBuffer>;
59
59
// Variant to store different types of buffers
60
60
using MessageBufferVariant = std::variant<ControlCommandBuffer, MessageBuffer>;
61
61
@@ -67,15 +67,15 @@ struct SubscriberVariables
67
67
std::unique_ptr<message_filters::Subscriber<MessageType>> sub1_;
68
68
std::unique_ptr<message_filters::Subscriber<PublishedTime>> sub2_;
69
69
std::unique_ptr<message_filters::Synchronizer<ExactTimePolicy>> synchronizer_;
70
- // tmp: only for the messages who don't have header e.g. AckermannControlCommand
70
+ // tmp: only for the messages who don't have header e.g. Control
71
71
std::unique_ptr<message_filters::Cache<PublishedTime>> cache_;
72
72
};
73
73
74
74
// Variant to create subscribers for different message types
75
75
using SubscriberVariablesVariant = std::variant<
76
76
SubscriberVariables<PointCloud2>, SubscriberVariables<DetectedObjects>,
77
77
SubscriberVariables<TrackedObjects>, SubscriberVariables<PredictedObjects>,
78
- SubscriberVariables<Trajectory>, SubscriberVariables<AckermannControlCommand >>;
78
+ SubscriberVariables<Trajectory>, SubscriberVariables<Control >>;
79
79
80
80
// The configuration of the topic to be subscribed which are defined in reaction_chain
81
81
struct TopicConfig
@@ -153,14 +153,11 @@ class SubscriberBase
153
153
bool init_subscribers ();
154
154
std::optional<SubscriberVariablesVariant> get_subscriber_variable (
155
155
const TopicConfig & topic_config);
156
- std::optional<size_t > find_first_brake_idx (
157
- const std::vector<AckermannControlCommand> & cmd_array);
158
- void set_control_command_to_buffer (
159
- std::vector<AckermannControlCommand> & buffer, const AckermannControlCommand & cmd) const ;
156
+ std::optional<size_t > find_first_brake_idx (const std::vector<Control> & cmd_array);
157
+ void set_control_command_to_buffer (std::vector<Control> & buffer, const Control & cmd) const ;
160
158
161
159
// Callbacks for modules are subscribed
162
- void on_control_command (
163
- const std::string & node_name, const AckermannControlCommand::ConstSharedPtr & msg_ptr);
160
+ void on_control_command (const std::string & node_name, const Control::ConstSharedPtr & msg_ptr);
164
161
void on_trajectory (const std::string & node_name, const Trajectory::ConstSharedPtr & msg_ptr);
165
162
void on_trajectory (
166
163
const std::string & node_name, const Trajectory::ConstSharedPtr & msg_ptr,
0 commit comments