Skip to content

Commit

Permalink
structure changes
Browse files Browse the repository at this point in the history
update
  • Loading branch information
brkay54 committed Jan 3, 2024
1 parent 06b2915 commit 370ffe2
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 210 deletions.
11 changes: 8 additions & 3 deletions tools/reaction_analyzer/include/reaction_analyzer_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class ReactionAnalyzerNode : public rclcpp::Node
tf2_ros::TransformListener tf_listener_{tf_buffer_};

// Functions
rclcpp::SubscriptionOptions createSubscriptionOptions();
bool loadChainModules();
bool initObservers(const ChainModules & modules);
void initAnalyzerVariables();
Expand All @@ -157,6 +158,11 @@ class ReactionAnalyzerNode : public rclcpp::Node
void setControlCommandToBuffer(
std::vector<AckermannControlCommand> & buffer, const AckermannControlCommand & cmd);
std::optional<size_t> findFirstBrakeIdx(const std::vector<AckermannControlCommand> & cmd_array);
void spawnObstacle(const geometry_msgs::msg::Point & ego_pose);
void searchForReactions(
const std::unordered_map<std::string, BufferVariant> & message_buffers,
const geometry_msgs::msg::Point & ego_pose);
void printResults(const std::unordered_map<std::string, BufferVariant> & message_buffers);
void onTimer();

// Callbacks
Expand All @@ -173,7 +179,7 @@ class ReactionAnalyzerNode : public rclcpp::Node

// Variables
std::vector<rclcpp::SubscriptionBase::SharedPtr> subscribers_;
std::unordered_map<std::string, BufferVariant> messageBuffers_;
std::unordered_map<std::string, BufferVariant> message_buffers_;
std::optional<rclcpp::Time> last_test_environment_init_time_;
std::optional<rclcpp::Time> spawn_cmd_time_;
bool is_test_environment_created_{false};
Expand All @@ -187,8 +193,7 @@ class ReactionAnalyzerNode : public rclcpp::Node

// Client
rclcpp::Client<ChangeOperationMode>::SharedPtr client_change_to_autonomous_;
void callOperationModeServiceWithoutResponse(
const rclcpp::Client<ChangeOperationMode>::SharedPtr client);
void callOperationModeServiceWithoutResponse();

// Pointers
PointCloud2::SharedPtr entity_pointcloud_ptr_;
Expand Down
10 changes: 6 additions & 4 deletions tools/reaction_analyzer/launch/reaction_analyzer.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<param from="$(var reaction_analyzer_param_path)"/>
<remap from="output/points_raw" to="/perception/obstacle_segmentation/pointcloud"/>
<remap from="output/objects" to="/perception/object_recognition/objects"/>
<remap from="output/initialpose" to="/initialpose"/>
<remap from="output/goal" to="/planning/mission_planning/goal"/>
<remap from="service/change_to_autonomous" to="/api/operation_mode/change_to_autonomous"/>
<remap from="input/kinematics" to="/localization/kinematic_state"/>
<!-- <remap from="input/localization_initialization_state" to="/localization/initialization_state"/>-->
<remap from="input/points_raw" to="/perception/obstacle_segmentation/pointcloud"/>
<remap from="input/trajectory_follower_cmd" to="/control/trajectory_follower/control_cmd"/>
<remap from="input/vehicle_cmd_gate_cmd" to="/control/command/control_cmd"/>
<remap from="input/localization_initialization_state" to="/api/localization/initialization_state"/>
<remap from="input/routing_state" to="/api/routing/state"/>
<remap from="input/operation_mode_state" to="/api/operation_mode/state"/>
<extra_arg name="use_intra_process_comms" value="false"/>
</composable_node>
</node_container>
Expand Down
Loading

0 comments on commit 370ffe2

Please sign in to comment.