Skip to content

Commit 33282c0

Browse files
authored
Merge pull request #178 from pockerman/feat/174-add-diff-drive-robot-model
finish RL environment example with Chrono (#174)
2 parents 8a41f4b + b6ca39a commit 33282c0

11 files changed

Lines changed: 721 additions & 265 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ OPTION(ENABLE_WEBOTS OFF)
3030
# configure packages
3131
SET(ENABLE_EXAMPLES ON)
3232
SET(ENABLE_TESTS OFF)
33-
SET(ENABLE_CHRONO ON)
3433
SET(ENABLE_OPENCV ON)
3534
SET(ENABLE_MQTT ON)
3635
SET(BITRL_LOG ON)
3736
SET(BITRL_IRRLICHT ON)
37+
SET(ENABLE_CHRONO ON)
3838

3939
# build options
4040
SET(CMAKE_BUILD_TYPE "Release")
@@ -143,6 +143,7 @@ INCLUDE_DIRECTORIES(/usr/local/include/) # mqtt
143143
INCLUDE_DIRECTORIES(src/)
144144

145145
FILE(GLOB SRCS src/bitrl/*.cpp
146+
src/bitrl/boards/arduino/*.cpp
146147
src/bitrl/network/*.cpp
147148
src/bitrl/sensors/*.cpp
148149
src/bitrl/sensors/messages/*.cpp
@@ -170,12 +171,13 @@ FILE(GLOB SRCS src/bitrl/*.cpp
170171
src/bitrl/utils/*.cpp
171172
src/bitrl/utils/io/*.cpp
172173
src/bitrl/utils/maths/statistics/distributions/*.cpp
174+
src/bitrl/utils/render/*.cpp
175+
src/bitrl/systems/*.cpp
173176
#src/bitrl/utils/geometry/*.cpp
174177
#src/bitrl/utils/geometry/shapes/*.cpp
175178
#src/bitrl/utils/geometry/mesh/*.cpp
176-
#src/bitrl/utils/trajectory/*.cpp
177-
src/bitrl/boards/arduino/*.cpp
178-
src/bitrl/systems/*.cpp
179+
#src/bitrl/utils/trajectory/*.cp
180+
179181
)
180182

181183
ADD_LIBRARY(bitrllib SHARED ${SRCS})

config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
/*Use Chrono*/
2020
#cmakedefine BITRL_CHRONO
2121

22+
/*Use Irrlicht for visualization*/
23+
#cmakedefine BITRL_IRRLICHT
24+
2225
/*Use OpenCV*/
2326
#cmakedefine BITRL_OPENCV
2427

examples/example_12/example_12.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ int main() {
194194

195195
// create the visualization system
196196
chrono::irrlicht::ChVisualSystemIrrlicht vis;
197-
198197
vis.AttachSystem(&system);
199198
vis.SetWindowSize(1280,720);
200199
vis.SetWindowTitle("Example 12 Differential Drive Robot");

examples/example_12/example_12.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Running a simulation with Chrono requires that we create a _ChSystem_ instance
1717
A _ChSystem_ is an abstract class. The Chrono library provides the following subclasses:
1818

1919
- _ChSystemNSC_ for Non Smooth Contacts (NSC): in case of contacts a complementarity solver will take care of them using non-smooth dynamics; this is very efficient even with large time steps.
20-
- _ChSystemSMC_ for SMooth Contacts (SMC): contacts are handled using penalty methods, i.e. contacts are deformable.
20+
- _ChSystemSMC_ for Smooth Contacts (SMC): contacts are handled using penalty methods, i.e. contacts are deformable.
2121

2222
Note that if there are no contacts or collisions in your system, it is indifferent to use _ChSystemNSC_ or _ChSystemSMC_.
2323

@@ -59,7 +59,7 @@ $$
5959
v = \frac{r}{2}(\omega_R + \omega_L)
6060
$$
6161

62-
where \f$r\f$ is the radius of the wheel and \f$\omega_i\f$ if the angular velocity of motor \f$\i\f$ in rad/s.
62+
where \f$r\f$ is the radius of the wheel and \f$\omega_i\f$ if the angular velocity of motor \f$i\f$ in rad/s.
6363
We can use this relationship in a control simulation in order to control either the linear velocity or the motor speed.
6464

6565
@code{.cpp}

0 commit comments

Comments
 (0)