-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathISimulation.hpp
54 lines (43 loc) · 1.46 KB
/
ISimulation.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#ifndef __I_SIMULATION_HPP__
#define __I_SIMULATION_HPP__
#include <yarp/os/Value.h>
namespace roboticslab
{
/**
* @ingroup YarpPlugins
*
* @brief Base class for simulators.
*/
class ISimulation
{
public:
/**
* Start the simulation (time steps will be called internally and continuously by the simulator).
* Simulation may default to already started, so may not be required upon initialization.
* @param value duration that the simulation should use within internal continuous calls to its step function
* @return true/false
*/
virtual bool start(double value) = 0;
/**
* Stops the simulation.
* @return true/false
*/
virtual bool stop() = 0;
/**
* Take one simulation time step (to be used when the simulation is stopped / not started).
* @param value duration of simulated time increment
* @return true/false
*/
virtual bool step(double value) = 0;
/**
* Retrieve a void pointer that can be casted to a world/environment pointer used to control any element of the simulation.
* @param value storage to return param
* @param id optional param to specify id in case there are multiple environments/worlds/simulations
* @return true/false
*/
virtual bool getSimulationRawPointerValue(yarp::os::Value& value) = 0;
virtual ~ISimulation() = default;
};
}
#endif //-- __I_SIMULATION_HPP__