Skip to content

Commit 8af62c7

Browse files
committed
feat(franka): option to keep tcp offset in desk (#262)
1 parent 0233a98 commit 8af62c7

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

extensions/rcs_fr3/src/hw/Franka.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ common::Pose Franka::get_cartesian_position() {
110110
x = common::Pose(this->curr_state.O_T_EE);
111111
this->interpolator_mutex.unlock();
112112
}
113+
if (!this->cfg.tcp_offset_configured_in_desk) {
114+
return x * cfg.tcp_offset;
115+
}
113116
return x;
114117
}
115118

extensions/rcs_fr3/src/hw/Franka.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct FrankaConfig : common::RobotConfig {
4343
std::optional<common::Pose> nominal_end_effector_frame = std::nullopt;
4444
std::optional<common::Pose> world_to_robot = std::nullopt;
4545
bool async_control = false;
46+
bool tcp_offset_configured_in_desk = true;
4647
};
4748

4849
struct FR3Config : FrankaConfig {};

extensions/rcs_fr3/src/pybind/rcs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ PYBIND11_MODULE(_core, m) {
133133
.def_readwrite("nominal_end_effector_frame",
134134
&rcs::hw::FrankaConfig::nominal_end_effector_frame)
135135
.def_readwrite("world_to_robot", &rcs::hw::FrankaConfig::world_to_robot)
136+
.def_readwrite("tcp_offset_configured_in_desk",
137+
&rcs::hw::FrankaConfig::tcp_offset_configured_in_desk)
136138
.def_readwrite("async_control", &rcs::hw::FrankaConfig::async_control);
137139

138140
py::class_<rcs::hw::FR3Config, rcs::hw::FrankaConfig>(hw, "FR3Config")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class FrankaConfig(rcs._core.common.RobotConfig):
100100
load_parameters: FrankaLoad | None
101101
nominal_end_effector_frame: rcs._core.common.Pose | None
102102
speed_factor: float
103+
tcp_offset_configured_in_desk: bool
103104
world_to_robot: rcs._core.common.Pose | None
104105
def __init__(self) -> None: ...
105106

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class FrankaConfig(rcs._core.common.RobotConfig):
100100
load_parameters: FrankaLoad | None
101101
nominal_end_effector_frame: rcs._core.common.Pose | None
102102
speed_factor: float
103+
tcp_offset_configured_in_desk: bool
103104
world_to_robot: rcs._core.common.Pose | None
104105
def __init__(self) -> None: ...
105106

0 commit comments

Comments
 (0)