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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ set(RL_BUILD_DEMOS OFF)
set(RL_BUILD_RL_SG OFF)
set(RL_BUILD_TESTS OFF)
set(RL_BUILD_EXTRAS OFF)
set(BUILD_PYTHON_INTERFACE OFF)
set(BUILD_DOCUMENTATION OFF)

option(INCLUDE_UTN_MODELS "Whether to include the private UTN models. Requires GITLAB_MODELS_TOKEN to be set to a valid token wit read_api permissions" OFF)

Expand All @@ -51,7 +53,7 @@ find_package(MuJoCo REQUIRED)
FetchContent_Declare(
libfranka
GIT_REPOSITORY https://github.com/frankaemika/libfranka.git
GIT_TAG 0.13.3
GIT_TAG 0.14.2
GIT_PROGRESS TRUE
EXCLUDE_FROM_ALL
)
Expand Down
45 changes: 45 additions & 0 deletions cmake/Findpinocchio.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
if (NOT pinocchio_FOUND)
if (NOT Python3_FOUND)
set(pinocchio_FOUND FALSE)
if (pinocchio_FIND_REQUIRED)
message(FATAL_ERROR "Could not find pinocchio. Please install pinocchio using pip.")
endif()
return()
endif()

# Check if the include directory exists
cmake_path(APPEND Python3_SITELIB cmeel.prefix include OUTPUT_VARIABLE pinocchio_INCLUDE_DIRS)
if (NOT EXISTS ${pinocchio_INCLUDE_DIRS})
set(pinocchio_FOUND FALSE)
if (pinocchio_FIND_REQUIRED)
message(FATAL_ERROR "Could not find pinocchio. Please install pinocchio using pip.")
endif()
return()
endif()

# Check if the library file exists
cmake_path(APPEND Python3_SITELIB cmeel.prefix lib libpinocchio.so OUTPUT_VARIABLE pinocchio_library_path)
if (NOT EXISTS ${pinocchio_library_path})
set(pinocchio_FOUND FALSE)
if (pinocchio_FIND_REQUIRED)
message(FATAL_ERROR "Could not find pinocchio. Please install pinocchio using pip.")
endif()
return()
endif()

# Extract version from the library filename
file(GLOB pinocchio_dist_info "${Python3_SITELIB}/pin-*.dist-info")
cmake_path(GET pinocchio_dist_info FILENAME pinocchio_library_filename)
string(REPLACE "pin-" "" pinocchio_VERSION "${pinocchio_library_filename}")
string(REPLACE ".dist-info" "" pinocchio_VERSION "${pinocchio_VERSION}")

# Create the imported target
add_library(pinocchio::pinocchio SHARED IMPORTED)
target_include_directories(pinocchio::pinocchio INTERFACE ${pinocchio_INCLUDE_DIRS})
set_target_properties(
pinocchio::pinocchio
PROPERTIES
IMPORTED_LOCATION "${pinocchio_library_path}"
)
set(pinocchio_FOUND TRUE)
endif()
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "0.3.1"
description="Python Interface for libfranka to control the Franka Research 3 Robot"
dependencies = ["websockets>=11.0",
"requests~=2.31",
"numpy==2.0",
"numpy",
"typer~=0.9",
"pydantic~=2.6",
"gymnasium~=0.29.1",
Expand All @@ -23,7 +23,9 @@ dependencies = ["websockets>=11.0",
"python-dotenv==1.0.1",
"opencv-python~=4.10.0.84",
# NOTE: when changing the mujoco version, also change it in requirements_dev.txt
"mujoco==3.2.6"
"mujoco==3.2.6",
# NOTE: Same for pinocchio (pin)
"pin==2.7.0"
]
readme = "README.md"
maintainers = [
Expand Down
2 changes: 1 addition & 1 deletion python/rcsss/control/vive.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def run(self):
)

# Compute angle around z axis: https://stackoverflow.com/questions/21483999/using-atan2-to-find-angle-between-two-vectors
rot_z = np.atan2(x_axis_rot.translation()[1], x_axis_rot.translation()[0]) - np.atan2(
rot_z = np.arctan2(x_axis_rot.translation()[1], x_axis_rot.translation()[0]) - np.arctan2(
x_axis.translation()[1], x_axis.translation()[0]
)
rot_z -= np.pi / 2
Expand Down
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ commitizen~=3.28.0
scikit-build-core>=0.3.3
pybind11
mujoco==3.2.6
pin==2.7.0
wheel
4 changes: 4 additions & 0 deletions src/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ set_target_properties(_core PROPERTIES
INSTALL_RPATH "$ORIGIN;$ORIGIN/../mujoco"
INTERPROCEDURAL_OPTIMIZATION TRUE
)
set_target_properties(franka PROPERTIES
INSTALL_RPATH "$ORIGIN/../cmeel.prefix/lib"
INTERPROCEDURAL_OPTIMIZATION TRUE
)
install(TARGETS _core franka DESTINATION rcsss COMPONENT python_package)
Loading