Skip to content

Commit

Permalink
Merge branch 'main' into joint_robot
Browse files Browse the repository at this point in the history
  • Loading branch information
akmaralAW authored Oct 24, 2023
2 parents 3fe0cbc + 3008541 commit c9a3843
Show file tree
Hide file tree
Showing 294 changed files with 93,968 additions and 434 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CMake

on:
push:
branches: [ "main" ]
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "dev" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down Expand Up @@ -47,17 +47,20 @@ jobs:

- name: Test Python Bindings
working-directory: ${{github.workspace}}/build
continue-on-error: true
run: |
python ../example/test_robot.py
- name: Test Python Viewer
continue-on-error: true
#NOTE: To see the robots in your computer use:
#VISUALIZE=1 python3 ../utils/viewer/viewer_test.py
working-directory: ${{github.workspace}}/build
run: |
python3 ../utils/viewer/viewer_test.py
- name: Test c++
continue-on-error: true
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "deps/pybind11"]
path = deps/pybind11
url = https://github.com/pybind/pybind11
[submodule "deps/json"]
path = deps/json
url = https://github.com/nlohmann/json
91 changes: 42 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ project(
LANGUAGES CXX)

# find_package(pinocchio REQUIRED)
find_package(Boost REQUIRED COMPONENTS program_options serialization)
find_package(Boost REQUIRED COMPONENTS program_options serialization stacktrace_basic)
find_package(fcl REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(Eigen3 REQUIRED)
# find_package(pybind11 REQUIRED)

add_subdirectory(deps/pybind11)
add_subdirectory(deps/json)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED On)
Expand Down Expand Up @@ -55,65 +56,57 @@ target_include_directories(

target_compile_options(dynobench PRIVATE -Wall -Wextra)

target_link_libraries(dynobench PUBLIC fcl yaml-cpp Boost::program_options
Boost::serialization)
target_link_libraries(
dynobench
PUBLIC fcl yaml-cpp Boost::program_options Boost::serialization Boost::stacktrace_basic ${CMAKE_DL_LIBS}
PUBLIC nlohmann_json::nlohmann_json)

target_link_libraries(
check_trajectory
PUBLIC dynobench
PRIVATE fcl yaml-cpp Boost::program_options Boost::serialization)

# Installation instructions

target_link_libraries(robot_python PUBLIC Eigen3::Eigen dynobench fcl)

include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/dynobench)

install(
TARGETS dynobench
EXPORT dynobench-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Export the targets to a script
install(
EXPORT dynobench-targets
FILE dynobenchTargets.cmake
NAMESPACE dynobench::
DESTINATION ${INSTALL_CONFIGDIR})

# Create a ConfigVersion.cmake file
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion)

configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/cmake/dynobenchConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfig.cmake
INSTALL_DESTINATION ${INSTALL_CONFIGDIR})

# Install the config, configversion and custom find modules
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfigVersion.cmake
DESTINATION ${INSTALL_CONFIGDIR})
# Installation instructions

#
# include(GNUInstallDirs) set(INSTALL_CONFIGDIR
# ${CMAKE_INSTALL_LIBDIR}/cmake/dynobench)
#
# install( TARGETS dynobench EXPORT dynobench-targets LIBRARY DESTINATION
# ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
#
# install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
#
# # Export the targets to a script install( EXPORT dynobench-targets FILE
# dynobenchTargets.cmake NAMESPACE dynobench:: DESTINATION ${INSTALL_CONFIGDIR})
#
# # Create a ConfigVersion.cmake file include(CMakePackageConfigHelpers)
# write_basic_package_version_file(
# ${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfigVersion.cmake VERSION
# ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion)
#
# configure_package_config_file(
# ${CMAKE_CURRENT_LIST_DIR}/cmake/dynobenchConfig.cmake.in
# ${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfig.cmake INSTALL_DESTINATION
# ${INSTALL_CONFIGDIR})
#
# # Install the config, configversion and custom find modules install(FILES
# ${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfig.cmake
# ${CMAKE_CURRENT_BINARY_DIR}/dynobenchConfigVersion.cmake DESTINATION
# ${INSTALL_CONFIGDIR})
#
# #
# ##############################################################################
# Exporting from the build tree
# configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/FindRapidJSON.cmake
# # Exporting from the build tree #
# configure_file(${CMAKE_CURRENT_LIST_DIR}/cmake/FindRapidJSON.cmake #
# ${CMAKE_CURRENT_BINARY_DIR}/FindRapidJSON.cmake COPYONLY)

export(
EXPORT dynobench-targets
FILE ${CMAKE_CURRENT_BINARY_DIR}/dynobenchTargets.cmake
NAMESPACE dynobench::)

# Register package in the User Package Registry
export(PACKAGE dynobench)
#
# export( EXPORT dynobench-targets FILE
# ${CMAKE_CURRENT_BINARY_DIR}/dynobenchTargets.cmake NAMESPACE dynobench::)
#
# # Register package in the User Package Registry export(PACKAGE dynobench)



Expand Down
100 changes: 89 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,42 @@ Dynobench 🦖 is a universal benchmark for kinodynamic motion planning. Develop
<img src="assets/dynobench.png" width=50% height=50%>
</p >


You will find multiple planners in [Dynoplan](https://github.com/quimortiz/dynoplan) 🦖

## Robots and Problem Description

TODO

## Motion Primitives


Acrobot
<p align="center">
<img src="assets/motions/primitives-acrobot.png" width=50% height=auto>
</p >

Planar Rotor
<p align="center">
<img src="assets/motions/primitives-quad2d.png" width=50% height=auto>
</p >

Planar Rotor Pole
<p align="center">
<img src="assets/motions/primitives-quad2dpole.png" width=50% height=auto>
</p >

Quadrotor
<p align="center">
<img src="assets/motions/primitives-quad3d.png" width=50% height=auto>
</p >

Unicycle1
<p align="center">
<img src="assets/motions/primitives-unicycle1.png" width=50% height=auto>
</p >


# Using Dynobench

### Submodule
Expand All @@ -23,7 +57,7 @@ Using `cmake`, import the library with:
```cmake
add_subdirectory(dynobench EXCLUDE_FROM_ALL) # use EXCLUDE_FROM_ALL to avoid
# building the tests
...cmake
...
target_link_libraries(
my_target
PRIVATE dynobench::dynobench )
Expand Down Expand Up @@ -99,12 +133,12 @@ target_link_libraries(main PRIVATE dynobench::dynobench yaml-cpp)
### Python Viewer

Check the viewers with:
```
```bash
python3 ../utils/viewer/viewer_test.py
```
and

```
```bash
VISUALIZE=1 python3 ../utils/viewer/viewer_test.py
```

Expand All @@ -131,10 +165,8 @@ In this short tutorial, we summarize the steps we followed to add the model

`Integrator2_2d` is a double integrator in 2d:

State: $\mathbf{x} = [x,y, \dot{x}, \dot{y}]$
Control: $\mathbf{u} = [\ddot{x} , \ddot{y}]$
Second order dynamics: $\frac{d}{d t}[ \dot{x}, \dot{y} ] = \mathbf{u}$
Step function $\mathbf{x}_{k+1} = A \mathbf{x} + B \mathbf{u} $
The state is $\mathbf{x} = [x,y, \dot{x}, \dot{y}]$, control is $\mathbf{u} = [\ddot{x} , \ddot{y}]$.
Second order dynamics are $\frac{d}{d t}[ \dot{x}, \dot{y} ] = \mathbf{u}$. Thus, the step function is $\mathbf{x}_{k+1} = A \mathbf{x} + B \mathbf{u} $
with:

```math
Expand All @@ -155,12 +187,10 @@ B =
\end{bmatrix}
```

Control Bounds: $|u_x| \leq 1$, $|u_y| \leq 1$

State Bounds: $|\dot{x}| \leq 1 $, $|\dot{y}| \leq 1 $
Control Bounds are $|u_x| \leq 1$, $|u_y| \leq 1$, and state bounds on velocity $|\dot{x}| \leq 1 $, $|\dot{y}| \leq 1 $.

First, we have implemented a new class in `src/integrator2_2d.cpp` and `include/dynobench/integrator2_2d.hpp`. We store all parameters in a separate class, `Integrator2_2d_params`.
A robot model implements 4 big functionalities: distance and cost bounds between states, a dynamics function, bounds on state and control, and collision . Check the code!
A robot model implements 4 main functionalities: distance and cost bounds between states, a dynamics function, bounds on state and control, and collision against obstacles. Check the code!

```cpp
// dynobench/double_integrator_2d.hpp and src/double_integrator_2d.hpp
Expand Down Expand Up @@ -228,6 +258,7 @@ class Robot :

class Integrator2_2dViewer (RobotViewer):
```

`RobotViewer` is a base class that provides default functionality. `Robot` is the class that draws the robot (e.g. using a rectangle )


Expand Down Expand Up @@ -282,6 +313,53 @@ The planners in Dynoplan that depend on OMPL require to implement a small wrappe
## More Motion Primitives
You will find a small set of motion primitives for each system in [dynobench](https://github.com/quimortiz/dynobench).
A large set of primitives for each system can be downloaded from Google Drive. This can be done manually with a web browser or using the command line with [gdown](https://github.com/wkentaro/gdown). For example:
```bash
gdown --fuzzy "https://drive.google.com/file/d/1r_ecGwdfvWnVWxPsvR4d8Hjcayxg5PsB/view?usp=drive_link"
```

All primitive in two ZIP files: https://drive.google.com/drive/folders/1-Nvctva17I8aFsWvHfdQFWTIDUNWwgcM?usp=drive_link

Primitves per system:

* unicycle1_v0
https://drive.google.com/file/d/15dXqC_OdrI8KjaHRNakYgk9IXLtTeMtt/view?usp=drive_link

* quadrotor_v1 (OMPL-style)
https://drive.google.com/file/d/1r_ecGwdfvWnVWxPsvR4d8Hjcayxg5PsB/view?usp=drive_link

* quadrotor_v0
https://drive.google.com/file/d/1j57kwE5hFgO-46LjStv_zqm6S5BFUsY8/view?usp=drive_link

* Acrobot_v0
https://drive.google.com/file/d/1mLiTgcpXSI9UHHss4Qt7AIsRwJPbPC2H/view?usp=drive_link

* Roto_Pole_v0
https://drive.google.com/file/d/1KMb4IDgucHN8uWI9YN_W07AhX59tkph_/view?usp=drive_link

* Planar Rotor_v0
https://drive.google.com/file/d/18kI3qXweA4RgvDxtV3vfxnfc_BhX52j8/view?usp=drive_link

* Car1_v0
https://drive.google.com/file/d/1TPX3c8RvMOy9hiaKL-kUE8M61OknDrDK/view?usp=drive_link

* Unicycle 2 _v0
https://drive.google.com/file/d/1PoK1kbiLRFq_hkv3pVWU0csNr4hap0WX/view?usp=drive_link

* Unicycle 1 v2
https://drive.google.com/file/d/1IvwN-e1jn5P0P1ILaVwSrUnIeBlFxhHI/view?usp=drive_link

* Unicycle 1 v1
https://drive.google.com/file/d/1OLuw5XICTueoZuleXOuD6vNh3PCWfHif/view?usp=drive_link




## Roadmap

Dynobench is still in an alpha stage.
Expand Down
Binary file added assets/motions/primitives-acrobot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/motions/primitives-quad2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/motions/primitives-quad2dpole.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/motions/primitives-quad3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/motions/primitives-unicycle1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions deps/json
Submodule json added at 5d2754
Binary file not shown.
Loading

0 comments on commit c9a3843

Please sign in to comment.