Skip to content

Commit 36641e0

Browse files
committed
fix(panda): symlink between panda and fr3
- refactored symlinks to work in the panda package - updated version numbers - added panda extension to version bumps - renamed cpp python submodule to franka to be more generic
1 parent d3a8c91 commit 36641e0

11 files changed

Lines changed: 47 additions & 20 deletions

File tree

extensions/rcs_fr3/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ clangcompile:
2424

2525
# Auto generation of CPP binding stub files
2626
stubgen:
27-
pybind11-stubgen -o ${PYSRC} --numpy-array-use-type-var rcs_fr3
27+
pybind11-stubgen -o src --numpy-array-use-type-var rcs_fr3
2828
find ./${PYSRC} -name '*.pyi' -print | xargs sed -i '1s/^/# ATTENTION: auto generated from C++ code, use `make stubgen` to update!\n/'
2929
find ./${PYSRC} -not -path "./${PYSRC}/_core/*" -name '*.pyi' -delete
3030
find ./${PYSRC}/_core -name '*.pyi' -print | xargs sed -i 's/tuple\[typing\.Literal\[\([0-9]\+\)\], typing\.Literal\[1\]\]/tuple\[typing\.Literal[\1]\]/g'
3131
find ./${PYSRC}/_core -name '*.pyi' -print | xargs sed -i 's/tuple\[\([M|N]\), typing\.Literal\[1\]\]/tuple\[\1\]/g'
32-
ruff check --fix {PYSRC}/_core
32+
ruff check --fix ${PYSRC}/_core
3333
isort ${PYSRC}/_core
3434
black ${PYSRC}/_core
3535

extensions/rcs_fr3/src/pybind/rcs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PYBIND11_MODULE(_core, m) {
3939
#endif
4040

4141
// HARDWARE MODULE
42-
auto hw = m.def_submodule("hw", "rcs fr3 module");
42+
auto hw = m.def_submodule("hw", "rcs franka module");
4343

4444
py::object robot_state =
4545
(py::object)py::module_::import("rcs").attr("common").attr("RobotState");

extensions/rcs_fr3/src/rcs_fr3/_core/hw/__init__.pyi

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ATTENTION: auto generated from C++ code, use `make stubgen` to update!
22
"""
3-
rcs fr3 module
3+
rcs franka module
44
"""
55
from __future__ import annotations
66

@@ -55,14 +55,19 @@ class FR3(rcs._core.common.Robot):
5555
def __init__(self, ip: str, ik: rcs._core.common.Kinematics | None = None) -> None: ...
5656
def automatic_error_recovery(self) -> None: ...
5757
def controller_set_joint_position(
58-
self, desired_q: numpy.ndarray[tuple[typing.Literal[7]], numpy.dtype[numpy.float64]]
58+
self,
59+
desired_q: numpy.ndarray[tuple[typing.Literal[7]], numpy.dtype[numpy.float64]],
5960
) -> None: ...
6061
def double_tap_robot_to_continue(self) -> None: ...
6162
def get_config(self) -> FR3Config: ...
6263
def get_state(self) -> FR3State: ...
6364
def osc_set_cartesian_position(self, desired_pos_EE_in_base_frame: rcs._core.common.Pose) -> None: ...
6465
def set_cartesian_position_ik(
65-
self, pose: rcs._core.common.Pose, max_time: float, elbow: float | None, max_force: float | None = 5
66+
self,
67+
pose: rcs._core.common.Pose,
68+
max_time: float,
69+
elbow: float | None,
70+
max_force: float | None = 5,
6671
) -> None: ...
6772
def set_cartesian_position_internal(self, pose: rcs._core.common.Pose) -> None: ...
6873
def set_config(self, cfg: FR3Config) -> bool: ...

extensions/rcs_panda/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5)
33
project(
44
rcs_panda
55
LANGUAGES C CXX
6-
VERSION 0.4.0
6+
VERSION 0.5.2
77
DESCRIPTION "RCS Libfranka integration"
88
)
99

extensions/rcs_panda/pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ build-backend = "scikit_build_core.build"
44

55
[project]
66
name = "rcs_panda"
7-
version = "0.4.0"
7+
version = "0.5.2"
88
description="RCS libfranka integration"
99
dependencies = [
10-
# NOTE: when changing the pin version, also change it in requirements_dev.txt
11-
"pin==3.7.0",
10+
"rcs>=0.5.0",
1211
]
1312
readme = "../../README.md"
1413
maintainers = [

extensions/rcs_panda/src/rcs_panda/_core/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ from __future__ import annotations
1616
from . import hw
1717

1818
__all__ = ["hw"]
19-
__version__: str = "0.4.0"
19+
__version__: str = "0.5.2"

extensions/rcs_panda/src/rcs_panda/_core/hw/__init__.pyi

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ATTENTION: auto generated from C++ code, use `make stubgen` to update!
22
"""
3-
rcs panda module
3+
rcs franka module
44
"""
55
from __future__ import annotations
66

@@ -52,19 +52,25 @@ class FHState(rcs._core.common.GripperState):
5252
def width(self) -> float: ...
5353

5454
class FR3(rcs._core.common.Robot):
55-
def __init__(self, ip: str, ik: rcs._core.common.IK | None = None) -> None: ...
55+
def __init__(self, ip: str, ik: rcs._core.common.Kinematics | None = None) -> None: ...
5656
def automatic_error_recovery(self) -> None: ...
5757
def controller_set_joint_position(
58-
self, desired_q: numpy.ndarray[tuple[typing.Literal[7]], numpy.dtype[numpy.float64]]
58+
self,
59+
desired_q: numpy.ndarray[tuple[typing.Literal[7]], numpy.dtype[numpy.float64]],
5960
) -> None: ...
6061
def double_tap_robot_to_continue(self) -> None: ...
61-
def get_parameters(self) -> FR3Config: ...
62+
def get_config(self) -> FR3Config: ...
6263
def get_state(self) -> FR3State: ...
6364
def osc_set_cartesian_position(self, desired_pos_EE_in_base_frame: rcs._core.common.Pose) -> None: ...
6465
def set_cartesian_position_ik(
65-
self, pose: rcs._core.common.Pose, max_time: float, elbow: float | None, max_force: float | None = 5
66+
self,
67+
pose: rcs._core.common.Pose,
68+
max_time: float,
69+
elbow: float | None,
70+
max_force: float | None = 5,
6671
) -> None: ...
6772
def set_cartesian_position_internal(self, pose: rcs._core.common.Pose) -> None: ...
73+
def set_config(self, cfg: FR3Config) -> bool: ...
6874
def set_default_robot_behavior(self) -> None: ...
6975
def set_guiding_mode(
7076
self,
@@ -76,7 +82,6 @@ class FR3(rcs._core.common.Robot):
7682
yaw: bool = True,
7783
elbow: bool = True,
7884
) -> None: ...
79-
def set_parameters(self, cfg: FR3Config) -> bool: ...
8085
def stop_control_thread(self) -> None: ...
8186
def zero_torque_guiding(self) -> None: ...
8287

@@ -100,11 +105,11 @@ class FR3State(rcs._core.common.RobotState):
100105

101106
class FrankaHand(rcs._core.common.Gripper):
102107
def __init__(self, ip: str, cfg: FHConfig) -> None: ...
103-
def get_parameters(self) -> FHConfig: ...
108+
def get_config(self) -> FHConfig: ...
104109
def get_state(self) -> FHState: ...
105110
def homing(self) -> bool: ...
106111
def is_grasped(self) -> bool: ...
107-
def set_parameters(self, cfg: FHConfig) -> bool: ...
112+
def set_config(self, cfg: FHConfig) -> bool: ...
108113

109114
class IKSolver:
110115
"""

extensions/rcs_panda/src_fr3/pybind

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pybind11_add_module(_core MODULE rcs.cpp)
2+
target_link_libraries(_core PRIVATE hw rcs pinocchio::all)
3+
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION})
4+
5+
set_target_properties(franka PROPERTIES
6+
INSTALL_RPATH "$ORIGIN/../cmeel.prefix/lib"
7+
INTERPROCEDURAL_OPTIMIZATION TRUE
8+
)
9+
set_target_properties(_core PROPERTIES
10+
INSTALL_RPATH "$ORIGIN;$ORIGIN/../rcs;$ORIGIN/../cmeel.prefix/lib"
11+
INTERPROCEDURAL_OPTIMIZATION TRUE
12+
)
13+
# in pip
14+
install(TARGETS _core franka DESTINATION rcs_panda COMPONENT python_package)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../rcs_fr3/src/pybind/rcs.cpp

0 commit comments

Comments
 (0)