bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
double_pendulum_system.h
Go to the documentation of this file.
1//
2// Created by alex on 11/15/25.
3//
4
5#ifndef DOUBLE_PENDULUM_SYSTEM_H
6#define DOUBLE_PENDULUM_SYSTEM_H
7
8#include "bitrl/bitrl_config.h"
9
10#ifdef BITRL_CHRONO
11
15#include "bitrl/bitrl_types.h"
16#include <chrono/physics/ChSystemNSC.h>
17//#include <chrono/physics/ChBodyEasy.h>
18//#include <chrono/physics/ChLinkRevolute.h>
19//#include <chrono/utils/ChUtilsCreators.h>
20
21namespace bitrl
22{
23namespace systems
24{
25struct DoublePendulumProperties
26{
27 real_t l1 = 1.0;
28 real_t l2 = 1.0;
29 real_t r1 = 1.0;
30 real_t r2 = 1.0;
31 real_t density = 1000.;
32};
33class DoublePendulumSystem
34{
35 public:
36 DoublePendulumSystem();
37
42 void build_system(const DoublePendulumProperties &props);
43
47 void enable_gravity();
48
49 bool has_gravity_enabled() const noexcept { return gravity_enabled_; }
50 bool is_initialized() const noexcept { return is_initialized_; }
51
52 protected:
53 chrono::ChSystemNSC system_;
54
55 private:
56 bool gravity_enabled_{false};
57 bool is_initialized_{false};
58};
59} // namespace systems
60} // namespace bitrl
61
62#endif
63#endif // DOUBLE_PENDULUM_SYSTEM_H
Definition bitrl_consts.h:14
double real_t
real_t
Definition bitrl_types.h:23