Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
93 changes: 56 additions & 37 deletions .github/workflows/ros-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,57 @@ name: Build and Test OCS2

on:
push:
branches: [ main ]
branches: [ ubuntu24-ci ]
pull_request:
branches: [ main ]
branches: [ ros-one-devel ]

jobs:
build:

# build both Debug and Release mode
strategy:
fail-fast: false
matrix:
build_type: [ Debug, Release ]

# environment: regular Ubuntu with a vanilla ROS container
runs-on: ubuntu-latest
container:
image: ros:noetic
runs-on: ubuntu-24.04
container:
image: ubuntu:24.04

steps:
- name: Environment Info
run: |
apt-get update
apt-get install -y lsb-release
pwd
uname -r
lsb_release -a

- name: System deps
run: |
apt-get update
apt-get install -y git ninja-build liburdfdom-dev liboctomap-dev libassimp-dev checkinstall wget rsync
apt-get install -y git ninja-build liburdfdom-dev liboctomap-dev libassimp-dev checkinstall wget rsync curl

- uses: actions/checkout@v2
- name: ROS One installation
run: |
curl -sSL https://ros.packages.techfak.net/gpg.key -o /etc/apt/keyrings/ros-one-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/ros-one-keyring.gpg] https://ros.packages.techfak.net $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros1.list
apt-get update
apt-get install -y python3-rosdep python3-catkin-tools
rosdep init
echo "yaml https://ros.packages.techfak.net/ros-one.yaml one" | tee /etc/ros/rosdep/sources.list.d/1-ros-one.list
rosdep update
apt-get install -y ros-one-desktop

- name: Pinocchio from robotpkg
run: |
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.asc | tee /etc/apt/keyrings/robotpkg.asc
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg.asc] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" | tee /etc/apt/sources.list.d/robotpkg.list
apt-get update
apt-get install -y robotpkg-coal robotpkg-pinocchio
echo "CMAKE_PREFIX_PATH=/opt/openrobots:${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
ref: ros-one-devel
path: src/ocs2

- name: Rosdep
Expand All @@ -43,36 +62,36 @@ jobs:

- name: Checkout dependencies
run: |
git clone --recurse-submodules https://github.com/leggedrobotics/pinocchio.git src/pinocchio
git clone --recurse-submodules https://github.com/leggedrobotics/hpp-fcl.git src/hpp-fcl
git clone https://github.com/leggedrobotics/ocs2_robotic_assets.git src/ocs2_robotic_assets

- name: Install RaiSim
run: |
git clone --depth 1 https://github.com/raisimTech/raisimLib.git -b v1.1.01 src/raisim_tech
cd src/raisim_tech
mkdir build
cd build
cmake .. -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
make -j4 && checkinstall
# - name: Install RaiSim
# run: |
# git clone --depth 1 https://github.com/raisimTech/raisimLib.git -b v1.1.01 src/raisim_tech
# cd src/raisim_tech
# mkdir build
# cd build
# cmake .. -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
# make -j4 && checkinstall

- name: Install ONNX Runtime
run: |
wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz -P tmp/microsoft
tar xf tmp/microsoft/onnxruntime-linux-x64-1.7.0.tgz -C tmp/microsoft
rsync -a tmp/microsoft/onnxruntime-linux-x64-1.7.0/include/ /usr/local/include/onnxruntime
rsync -a tmp/microsoft/onnxruntime-linux-x64-1.7.0/lib/ /usr/local/lib
rsync -a src/ocs2/ocs2_mpcnet/ocs2_mpcnet_core/misc/onnxruntime/cmake/ /usr/local/share/onnxruntime
# - name: Install ONNX Runtime
# run: |
# wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz -P tmp/microsoft
# tar xf tmp/microsoft/onnxruntime-linux-x64-1.7.0.tgz -C tmp/microsoft
# rsync -a tmp/microsoft/onnxruntime-linux-x64-1.7.0/include/ /usr/local/include/onnxruntime
# rsync -a tmp/microsoft/onnxruntime-linux-x64-1.7.0/lib/ /usr/local/lib
# rsync -a src/ocs2/ocs2_mpcnet/ocs2_mpcnet_core/misc/onnxruntime/cmake/ /usr/local/share/onnxruntime

- name: Build (${{ matrix.build_type }})
- name: Build Release
shell: bash
run: |
source /opt/ros/noetic/setup.bash
catkin_make_isolated --use-ninja --merge --only-pkg-with-deps ocs2 --cmake-args -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
source /opt/ros/one/setup.bash
catkin init
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build ocs2_legged_robot_ros ocs2_self_collision_visualization

- name: Test
shell: bash
run: |
source devel_isolated/setup.bash
catkin_make_isolated --use-ninja --merge --only-pkg-with-deps ocs2 --catkin-make-args run_tests
catkin_test_results
# - name: Test
# shell: bash
# run: |
# source devel_isolated/setup.bash
# catkin_make_isolated --use-ninja --merge --only-pkg-with-deps ocs2 --catkin-make-args run_tests
# catkin_test_results
3 changes: 2 additions & 1 deletion ocs2_pinocchio/ocs2_pinocchio_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ find_package(catkin REQUIRED COMPONENTS
${CATKIN_PACKAGE_DEPENDENCIES}
)

find_package(urdfdom REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(pinocchio REQUIRED)
find_package(Eigen3 3.3 REQUIRED NO_MODULE)

# Add pinocchio configurations
include(cmake/pinocchio_config.cmake)

Expand Down Expand Up @@ -47,6 +47,7 @@ include_directories(
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${pinocchio_INCLUDE_DIRS}
${urdfdom_INCLUDE_DIRS}
)

# ocs2 pinocchio interface library
Expand Down
15 changes: 10 additions & 5 deletions ocs2_pinocchio/ocs2_self_collision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ find_package(catkin REQUIRED COMPONENTS

find_package(PkgConfig REQUIRED)
pkg_check_modules(coal REQUIRED coal)

#find_package(coal REQUIRED)
find_package(pinocchio REQUIRED)
# requires liboctomap-dev and libassimp-dev

find_package(urdfdom REQUIRED)
find_package(Eigen3 3.3 REQUIRED NO_MODULE)

###################################
Expand Down Expand Up @@ -56,11 +58,13 @@ include_directories(
${EIGEN3_INCLUDE_DIRS}
${pinocchio_INCLUDE_DIRS}
${coal_INCLUDE_DIRS}
${urdfdom_INCLUDE_DIRS}
)

#link_directories(
# ${pinocchio_LIBRARY_DIRS}
#)
link_directories(
${pinocchio_LIBRARY_DIRS}
${coal_LIBRARY_DIRS}
)

# ocs2 pinocchio interface library
add_library(${PROJECT_NAME}
Expand All @@ -75,7 +79,8 @@ add_dependencies(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
pinocchio::pinocchio
${coal_LIBRARIES}
${pinocchio_LIBRARIES}
)
target_compile_options(${PROJECT_NAME} PUBLIC ${FLAGS})

Expand Down
Loading