Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use cmake and Docker #30

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
dbbd888
hard reset
vincekurtz Jun 28, 2024
22eb4d6
copy over drake_cmake_installed
vincekurtz Jun 28, 2024
aad324a
add toy example
vincekurtz Jun 28, 2024
5ee86d7
unit test toy example
vincekurtz Jun 28, 2024
69954a7
pybind toy example
vincekurtz Jun 28, 2024
acad759
remove demo fluff
vincekurtz Jun 28, 2024
08bff44
pip install works with toy example
vincekurtz Jun 29, 2024
929c608
re-organize
vincekurtz Jun 29, 2024
7c86dab
treat warnings as errors
vincekurtz Jun 30, 2024
ad72b6c
update readme
vincekurtz Jun 30, 2024
4daa478
add profiler
vincekurtz Jun 30, 2024
18fcf3d
[WIP] pentadiagonal solver tests pass
vincekurtz Jun 30, 2024
789104d
optimizer compile, tests fail on find_resource
vincekurtz Jun 30, 2024
7e1f900
add new find_resource utils
vincekurtz Jun 30, 2024
f8d5b0c
most optimizer tests pass
vincekurtz Jun 30, 2024
3cc8a44
all optimizer tests pass
vincekurtz Jul 1, 2024
8476b4b
example base compiles
vincekurtz Jul 1, 2024
9894644
acrobot example runs (but slowly)
vincekurtz Jul 1, 2024
d6d7a11
better performance with compiler optimization -O3
vincekurtz Jul 1, 2024
0a23b0e
add acrobot test
vincekurtz Jul 1, 2024
3c7074a
airhockey example working
vincekurtz Jul 1, 2024
373609b
allegro hand working
vincekurtz Jul 1, 2024
8f70e9f
dual jaco working
vincekurtz Jul 1, 2024
2ed3dda
hopper working
vincekurtz Jul 1, 2024
0bb70cd
all remaining examples run
vincekurtz Jul 1, 2024
467cc5e
reorganize to remove src directory
vincekurtz Jul 1, 2024
1ea52b9
add problem definition bindings
vincekurtz Jul 1, 2024
1459d6a
make (untested) python bindings
vincekurtz Jul 1, 2024
d2b722d
update for drake v1.30.0
vincekurtz Jul 1, 2024
13dfcbb
put python tests in one place
vincekurtz Jul 1, 2024
22dbfe4
add more bindings tests
vincekurtz Jul 1, 2024
c45ea42
add python bindings for FindIdtoResource
vincekurtz Jul 1, 2024
191886b
add CreateWarmStart function
vincekurtz Jul 1, 2024
9eec7ba
test optimizer bindings
vincekurtz Jul 1, 2024
f93ea5a
test warm start
vincekurtz Jul 1, 2024
eadaba4
minor cleanup
vincekurtz Jul 1, 2024
eeba51b
remove toy example
vincekurtz Jul 8, 2024
e16e9b4
add open-loop spinner example
vincekurtz Jul 8, 2024
23c0a3b
fix bindings name and make example executable
vincekurtz Jul 8, 2024
5b51564
add python spinner mpc example
vincekurtz Jul 8, 2024
7ef7976
add mini cheetah MPC example
vincekurtz Jul 8, 2024
f03518a
enable parallelization with openmp
vincekurtz Jul 8, 2024
ffddddb
update python path
vincekurtz Jul 23, 2024
d3d26a6
update README
vincekurtz Jul 23, 2024
07a6afa
add dockerfile
vincekurtz Dec 5, 2024
f8c1039
add screenshots to readme
vincekurtz Dec 5, 2024
1e00181
Update README.md
vincekurtz Dec 6, 2024
2426a02
build the python bindings in the docker
vincekurtz Dec 6, 2024
e57e5af
fix readme formatting
vincekurtz Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .bazelproject

This file was deleted.

35 changes: 0 additions & 35 deletions .bazelrc

This file was deleted.

3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
img/
README.md
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# SPDX-License-Identifier: MIT-0

*.swp
.vscode
/bazel-*
/user.bazelrc
__pycache__
build
*.egg-info
23 changes: 0 additions & 23 deletions BUILD.bazel

This file was deleted.

49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.10.2)
project(idto)

# N.B. This is a temporary flag. It only really applies to Linux, as Mac
# does not need X11.
option(RUN_X11_TESTS "Run tests that require X11" OFF)

include(CTest)

find_package(drake CONFIG REQUIRED)

find_package(PythonInterp ${drake_PYTHON_VERSION} MODULE REQUIRED EXACT)

find_program(PYTHON_EXECUTABLE NAMES python3
PATHS "${FIND_PYTHON_EXECUTABLE_PATHS}"
NO_DEFAULT_PATH
)

execute_process(COMMAND ${PYTHON_EXECUTABLE}-config --exec-prefix
OUTPUT_VARIABLE PYTHON_EXEC_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
list(APPEND CMAKE_PREFIX_PATH "${PYTHON_EXEC_PREFIX}")
find_package(PythonLibs ${drake_PYTHON_VERSION} MODULE REQUIRED EXACT)

get_filename_component(PYTHONPATH
"${drake_DIR}/../../python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages"
REALPATH
)

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_compile_options(-Werror -Wall) # treat warnings as errors
add_compile_options(-O3)
# add_compile_definitions(ENABLE_TIMERS) # extra profiling

# Allow us to find resources (e.g. urdfs) in the build directory.
add_compile_definitions(IDTO_BINARY_DIR="${CMAKE_BINARY_DIR}")

add_subdirectory(third_party)
add_subdirectory(python_bindings)
add_subdirectory(utils)
add_subdirectory(optimizer)
add_subdirectory(models)
add_subdirectory(examples)

37 changes: 0 additions & 37 deletions CPPLINT.cfg

This file was deleted.

45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# syntax=docker/dockerfile:1

FROM ubuntu:jammy
SHELL ["/bin/bash", "-c", "-i"]
ENV TZ=America/Los_Angeles
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /home

# Set up python 3.10 and alias it with 'python'
RUN apt update -y
RUN apt install -y \
build-essential \
vim \
cmake \
git \
python3.10 \
python-is-python3 \
wget \
python3-pip

# Run drake installation
RUN wget https://github.com/RobotLocomotion/drake/releases/download/v1.30.0/drake-1.30.0-jammy.tar.gz && \
tar -xvzf drake-1.30.0-jammy.tar.gz && \
rm drake-1.30.0-jammy.tar.gz
WORKDIR /home/drake
RUN ./share/drake/setup/install_prereqs -y && \
apt-get install -y libgflags-dev ninja-build && \
pip install scipy==1.12
RUN echo 'export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/home/drake' >> ~/.bashrc && \
echo 'export PYTHONPATH=${PYTHONPATH}:/home/drake/lib/python3.10/site-packages' >> ~/.bashrc && \
source ~/.bashrc

# Copy the current directory contents into the container
COPY . /home/idto
WORKDIR /home/idto

# Build the C++ binaries
RUN mkdir build
WORKDIR /home/idto/build
RUN cmake .. && make -j

# Build the python bindings
WORKDIR /home/idto/
RUN pip install .
20 changes: 0 additions & 20 deletions LICENSE

This file was deleted.

Loading