Skip to content

Commit 78dc791

Browse files
authored
Merge pull request #157 from utn-mi/libranka-0.14.2-version-bump
Libfranka 0.14.2 version bump
2 parents 8c1c404 + 3ba9146 commit 78dc791

6 files changed

Lines changed: 58 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ set(RL_BUILD_DEMOS OFF)
3838
set(RL_BUILD_RL_SG OFF)
3939
set(RL_BUILD_TESTS OFF)
4040
set(RL_BUILD_EXTRAS OFF)
41+
set(BUILD_PYTHON_INTERFACE OFF)
42+
set(BUILD_DOCUMENTATION OFF)
4143

4244
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)
4345

@@ -51,7 +53,7 @@ find_package(MuJoCo REQUIRED)
5153
FetchContent_Declare(
5254
libfranka
5355
GIT_REPOSITORY https://github.com/frankaemika/libfranka.git
54-
GIT_TAG 0.13.3
56+
GIT_TAG 0.14.2
5557
GIT_PROGRESS TRUE
5658
EXCLUDE_FROM_ALL
5759
)

cmake/Findpinocchio.cmake

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
if (NOT pinocchio_FOUND)
2+
if (NOT Python3_FOUND)
3+
set(pinocchio_FOUND FALSE)
4+
if (pinocchio_FIND_REQUIRED)
5+
message(FATAL_ERROR "Could not find pinocchio. Please install pinocchio using pip.")
6+
endif()
7+
return()
8+
endif()
9+
10+
# Check if the include directory exists
11+
cmake_path(APPEND Python3_SITELIB cmeel.prefix include OUTPUT_VARIABLE pinocchio_INCLUDE_DIRS)
12+
if (NOT EXISTS ${pinocchio_INCLUDE_DIRS})
13+
set(pinocchio_FOUND FALSE)
14+
if (pinocchio_FIND_REQUIRED)
15+
message(FATAL_ERROR "Could not find pinocchio. Please install pinocchio using pip.")
16+
endif()
17+
return()
18+
endif()
19+
20+
# Check if the library file exists
21+
cmake_path(APPEND Python3_SITELIB cmeel.prefix lib libpinocchio.so OUTPUT_VARIABLE pinocchio_library_path)
22+
if (NOT EXISTS ${pinocchio_library_path})
23+
set(pinocchio_FOUND FALSE)
24+
if (pinocchio_FIND_REQUIRED)
25+
message(FATAL_ERROR "Could not find pinocchio. Please install pinocchio using pip.")
26+
endif()
27+
return()
28+
endif()
29+
30+
# Extract version from the library filename
31+
file(GLOB pinocchio_dist_info "${Python3_SITELIB}/pin-*.dist-info")
32+
cmake_path(GET pinocchio_dist_info FILENAME pinocchio_library_filename)
33+
string(REPLACE "pin-" "" pinocchio_VERSION "${pinocchio_library_filename}")
34+
string(REPLACE ".dist-info" "" pinocchio_VERSION "${pinocchio_VERSION}")
35+
36+
# Create the imported target
37+
add_library(pinocchio::pinocchio SHARED IMPORTED)
38+
target_include_directories(pinocchio::pinocchio INTERFACE ${pinocchio_INCLUDE_DIRS})
39+
set_target_properties(
40+
pinocchio::pinocchio
41+
PROPERTIES
42+
IMPORTED_LOCATION "${pinocchio_library_path}"
43+
)
44+
set(pinocchio_FOUND TRUE)
45+
endif()

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version = "0.3.1"
88
description="Python Interface for libfranka to control the Franka Research 3 Robot"
99
dependencies = ["websockets>=11.0",
1010
"requests~=2.31",
11-
"numpy==2.0",
11+
"numpy",
1212
"typer~=0.9",
1313
"pydantic~=2.6",
1414
"gymnasium~=0.29.1",
@@ -23,7 +23,9 @@ dependencies = ["websockets>=11.0",
2323
"python-dotenv==1.0.1",
2424
"opencv-python~=4.10.0.84",
2525
# NOTE: when changing the mujoco version, also change it in requirements_dev.txt
26-
"mujoco==3.2.6"
26+
"mujoco==3.2.6",
27+
# NOTE: Same for pinocchio (pin)
28+
"pin==2.7.0"
2729
]
2830
readme = "README.md"
2931
maintainers = [

python/rcsss/control/vive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def run(self):
130130
)
131131

132132
# Compute angle around z axis: https://stackoverflow.com/questions/21483999/using-atan2-to-find-angle-between-two-vectors
133-
rot_z = np.atan2(x_axis_rot.translation()[1], x_axis_rot.translation()[0]) - np.atan2(
133+
rot_z = np.arctan2(x_axis_rot.translation()[1], x_axis_rot.translation()[0]) - np.arctan2(
134134
x_axis.translation()[1], x_axis.translation()[0]
135135
)
136136
rot_z -= np.pi / 2

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ commitizen~=3.28.0
1010
scikit-build-core>=0.3.3
1111
pybind11
1212
mujoco==3.2.6
13+
pin==2.7.0
1314
wheel

src/pybind/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ set_target_properties(_core PROPERTIES
66
INSTALL_RPATH "$ORIGIN;$ORIGIN/../mujoco"
77
INTERPROCEDURAL_OPTIMIZATION TRUE
88
)
9+
set_target_properties(franka PROPERTIES
10+
INSTALL_RPATH "$ORIGIN/../cmeel.prefix/lib"
11+
INTERPROCEDURAL_OPTIMIZATION TRUE
12+
)
913
install(TARGETS _core franka DESTINATION rcsss COMPONENT python_package)

0 commit comments

Comments
 (0)