scenario_simulator_v2 C++ API
traffic_sink.hpp
Go to the documentation of this file.
1 
12 // Copyright 2015 TIER IV.inc. All rights reserved.
13 //
14 // Licensed under the Apache License, Version 2.0 (the "License");
15 // you may not use this file except in compliance with the License.
16 // You may obtain a copy of the License at
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 // See the License for the specific language governing permissions and
24 // limitations under the License.
25 
26 #ifndef TRAFFIC_SIMULATOR__TRAFFIC__TRAFFIC_SINK_HPP_
27 #define TRAFFIC_SIMULATOR__TRAFFIC__TRAFFIC_SINK_HPP_
28 
29 #include <functional>
30 #include <geometry_msgs/msg/pose.hpp>
31 #include <string>
33 #include <vector>
34 
35 namespace traffic_simulator
36 {
37 namespace traffic
38 {
40 {
41 public:
42  explicit TrafficSink(
43  double radius, const geometry_msgs::msg::Point & position,
44  const std::function<std::vector<std::string>(void)> & get_entity_names_function,
45  const std::function<geometry_msgs::msg::Pose(const std::string &)> & get_entity_pose_function,
46  const std::function<void(std::string)> & despawn_function);
47  const double radius;
48  const geometry_msgs::msg::Point position;
49  void execute(const double current_time, const double step_time) override;
50 
51 private:
52  const std::function<std::vector<std::string>(void)> get_entity_names_function;
53  const std::function<geometry_msgs::msg::Pose(const std::string &)> get_entity_pose_function;
54  const std::function<void(const std::string &)> despawn_function;
55 };
56 } // namespace traffic
57 } // namespace traffic_simulator
58 
59 #endif // TRAFFIC_SIMULATOR__TRAFFIC__TRAFFIC_SINK_HPP_
Definition: traffic_module_base.hpp:34
Definition: traffic_sink.hpp:40
TrafficSink(double radius, const geometry_msgs::msg::Point &position, const std::function< std::vector< std::string >(void)> &get_entity_names_function, const std::function< geometry_msgs::msg::Pose(const std::string &)> &get_entity_pose_function, const std::function< void(std::string)> &despawn_function)
Definition: traffic_sink.cpp:38
void execute(const double current_time, const double step_time) override
Definition: traffic_sink.cpp:52
const geometry_msgs::msg::Point position
Definition: traffic_sink.hpp:48
const double radius
Definition: traffic_sink.hpp:47
Definition: api.hpp:48
std::string string
Definition: junit5.hpp:26