Flatland
simulation_manager.h
1 /*
2  * ______ __ __ __
3  * /\ _ \ __ /\ \/\ \ /\ \__
4  * \ \ \L\ \ __ __ /\_\ \_\ \ \ \____ ___\ \ ,_\ ____
5  * \ \ __ \/\ \/\ \\/\ \ /'_` \ \ '__`\ / __`\ \ \/ /',__\
6  * \ \ \/\ \ \ \_/ |\ \ \/\ \L\ \ \ \L\ \/\ \L\ \ \ \_/\__, `\
7  * \ \_\ \_\ \___/ \ \_\ \___,_\ \_,__/\ \____/\ \__\/\____/
8  * \/_/\/_/\/__/ \/_/\/__,_ /\/___/ \/___/ \/__/\/___/
9  * @copyright Copyright 2017 Avidbots Corp.
10  * @name simulation_manager.h
11  * @brief Simulation manager class header definition
12  * @author Joseph Duchesne
13  *
14  * Software License Agreement (BSD License)
15  *
16  * Copyright (c) 2017, Avidbots Corp.
17  * All rights reserved.
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions
21  * are met:
22  *
23  * * Redistributions of source code must retain the above copyright
24  * notice, this list of conditions and the following disclaimer.
25  * * Redistributions in binary form must reproduce the above
26  * copyright notice, this list of conditions and the following
27  * disclaimer in the documentation and/or other materials provided
28  * with the distribution.
29  * * Neither the name of the Avidbots Corp. nor the names of its
30  * contributors may be used to endorse or promote products derived
31  * from this software without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
36  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
38  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
39  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
43  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44  * POSSIBILITY OF SUCH DAMAGE.
45  */
46 
47 #ifndef FLATLAND_SERVER_SIMULATION_MANAGER_H
48 #define FLATLAND_SERVER_SIMULATION_MANAGER_H
49 
50 #include <Box2D/Box2D.h>
51 #include <flatland_server/debug_visualization.h>
52 #include <flatland_server/timekeeper.h>
53 #include <flatland_server/world.h>
54 #include <string>
55 
56 namespace flatland_server {
57 
59  public:
62  double update_rate_;
63  double step_size_;
64  bool show_viz_;
65  double viz_pub_rate_;
66  std::string world_yaml_file_;
67 
77  SimulationManager(std::string world_yaml_file, double update_rate,
78  double step_size, bool show_viz, double viz_pub_rate);
79 
83  void Main();
84 
88  void Shutdown();
89 };
90 }; // namespace flatland_server
91 #endif // FLATLAND_SERVER_SIMULATION_MANAGER_H
void Main()
Definition: simulation_manager.cpp:76
double viz_pub_rate_
rate to publish visualization
Definition: simulation_manager.h:65
bool run_simulator_
While true, keep running the sim loop.
Definition: simulation_manager.h:60
Definition: body.h:55
std::string world_yaml_file_
path to the world file
Definition: simulation_manager.h:66
bool show_viz_
flag to determine if to show visualization
Definition: simulation_manager.h:64
World * world_
Simulation world.
Definition: simulation_manager.h:61
void Shutdown()
Definition: simulation_manager.cpp:140
double step_size_
step size
Definition: simulation_manager.h:63
Definition: world.h:69
double update_rate_
sim loop rate
Definition: simulation_manager.h:62
Definition: simulation_manager.h:58