Rby1#
- class rb_sdk.rb_sdk_cpp.RBRby1CommandHandle#
Bases:
pybind11_object로봇 명령 핸들 (RBRby1SDK.send_command 결과, 공식 RobotCommandHandler 래퍼).
블로킹 메서드(wait/get)는 기본 async,
handle.sync.<method>는 동기다. 핸들을 버리면 명령이 취소된다 (공식 소멸자 = Cancel) — 명령이 끝날 때까지 핸들을 쥐고 있어야 한다. async wait/get 을 기다리던 쪽이 취소되면(Task.cancel, asyncio.wait_for 타임아웃, 루프 종료) 결과만 버리지 않고 로봇 명령도 취소한다 (cancel()). 이때 flow_manager_args.done() 은 부르지 않는다. disconnect_robot 뒤에도 이미 보낸 명령의 wait/get/is_done/cancel 은 그 명령에 대해 동작한다. fork 자식에서는 부모의 핸들을 쓸 수 없다 (RBY1ConnectionError, cancel 은 할 일 없음).- cancel(self: rb_sdk.rb_sdk_cpp.RBRby1CommandHandle) None#
명령을 취소한다 (기다리지 않는다). 이미 끝났거나 fork 로 버려진 핸들이면 아무것도 하지 않는다.
- get(self, *, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback]#
명령이 끝날 때까지 기다려 최종 피드백을 받는다.
- Parameters:
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.RobotCommandFeedback (공식 타입). 성공 여부는 finish_code 로 확인한다.
- Raises:
RBY1Error – gRPC 실패(취소됨·연결 끊김 등). RBY1ConnectionError fork 자식에서 부모 핸들 사용.
- get_status(self: rb_sdk.rb_sdk_cpp.RBRby1CommandHandle) bool#
끝난 명령의 gRPC 상태.
- Returns:
gRPC 호출이 성공했으면 True (취소·연결 실패면 False, 진행 중이면 True).
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- is_done(self: rb_sdk.rb_sdk_cpp.RBRby1CommandHandle) bool#
명령이 끝났는지 (완료·취소·실패 모두).
- Returns:
끝났으면 True.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- property sync#
동기 호출 뷰 (PyFM step/스크립트용).
- wait(self, *, timeout_ms: int | None = None, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
명령이 끝날 때까지 기다린다.
- Parameters:
timeout_ms – 최대 대기(ms). None 이면 끝날 때까지.
flow_manager_args – Optional PyFM step context. 명령이 끝났으면(True) done() 을 호출한다.
- Returns:
끝났으면 True, 타임아웃이면 False.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- class rb_sdk.rb_sdk_cpp.RBRby1CommandHandleSync#
Bases:
pybind11_object핸들의 동기 호출 뷰 (handle.sync). GIL 을 풀고 호출 스레드에서 기다린다.
- get(self: rb_sdk.rb_sdk_cpp.RBRby1CommandHandleSync, *, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
명령이 끝날 때까지 기다려 최종 피드백을 받는다.
- Parameters:
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.RobotCommandFeedback (공식 타입). 성공 여부는 finish_code 로 확인한다.
- Raises:
RBY1Error – gRPC 실패(취소됨·연결 끊김 등). RBY1ConnectionError fork 자식에서 부모 핸들 사용.
- wait(self: rb_sdk.rb_sdk_cpp.RBRby1CommandHandleSync, *, timeout_ms: int | None = None, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
명령이 끝날 때까지 기다린다.
- Parameters:
timeout_ms – 최대 대기(ms). None 이면 끝날 때까지.
flow_manager_args – Optional PyFM step context. 명령이 끝났으면(True) done() 을 호출한다.
- Returns:
끝났으면 True, 타임아웃이면 False.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- class rb_sdk.rb_sdk_cpp.RBRby1CommandStream#
Bases:
pybind11_object명령 스트림 핸들 (RBRby1SDK.create_command_stream 결과, 공식 RobotCommandStreamHandler 래퍼).
한 연결로 명령을 연이어 보낸다. 블로킹 메서드는 기본 async,
stream.sync.<method>는 동기다. 핸들을 버리면 스트림이 취소된다 (공식 소멸자). async 호출을 기다리던 쪽이 취소되면 스트림도 취소한다. disconnect_robot / connect_robot 뒤에는 새 명령(send_command/request_feedback)을 보내지 않는다 (RBY1ConnectionError) — wait/cancel/is_done 은 계속 동작한다.- cancel(self: rb_sdk.rb_sdk_cpp.RBRby1CommandStream) None#
스트림을 취소한다 (기다리지 않는다). fork 로 버려진 핸들이면 아무것도 하지 않는다.
- is_done(self: rb_sdk.rb_sdk_cpp.RBRby1CommandStream) bool#
스트림이 끝났는지.
- Returns:
끝났으면 True.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- request_feedback(self, *, timeout_ms: int = 1000) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback]#
진행 중인 명령의 제어기 피드백을 요청한다 (send_command 뒤에만).
- Parameters:
timeout_ms – 피드백 대기(ms).
- Returns:
rby1.RobotCommandFeedback (공식 타입).
- Raises:
RBY1Error – 스트림 만료·타임아웃·명령 전. RBY1ConnectionError 연결이 바뀜/끊김.
- send_command(self, *, builder: rb_sdk_cpp.rby1.RobotCommandBuilder, timeout_ms: int = 1000) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback]#
스트림으로 명령을 보내고 제어기 피드백을 받는다 (명령 완료가 아니라 현재 상태).
- Parameters:
builder – rby1.RobotCommandBuilder (공식 타입).
timeout_ms – 피드백 대기(ms). 넘기면 공식 SDK 가 스트림을 취소한다.
- Returns:
rby1.RobotCommandFeedback (공식 타입).
- Raises:
RBY1Error – 스트림 만료·타임아웃·이전 명령 진행 중. RBY1ConnectionError 연결이 바뀜/끊김.
- property sync#
동기 호출 뷰 (PyFM step/스크립트용).
- wait(self, *, timeout_ms: int | None = None) Coroutine[Any, Any, bool]#
스트림이 끝날(닫히거나 취소될) 때까지 기다린다.
- Parameters:
timeout_ms – 최대 대기(ms). None 이면 끝날 때까지.
- Returns:
끝났으면 True, 타임아웃이면 False.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- class rb_sdk.rb_sdk_cpp.RBRby1CommandStreamSync#
Bases:
pybind11_object핸들의 동기 호출 뷰 (handle.sync). GIL 을 풀고 호출 스레드에서 기다린다.
- request_feedback(self: rb_sdk.rb_sdk_cpp.RBRby1CommandStreamSync, *, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
진행 중인 명령의 제어기 피드백을 요청한다 (send_command 뒤에만).
- Parameters:
timeout_ms – 피드백 대기(ms).
- Returns:
rby1.RobotCommandFeedback (공식 타입).
- Raises:
RBY1Error – 스트림 만료·타임아웃·명령 전. RBY1ConnectionError 연결이 바뀜/끊김.
- send_command(self: rb_sdk.rb_sdk_cpp.RBRby1CommandStreamSync, *, builder: rb_sdk_cpp.rby1.RobotCommandBuilder, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
스트림으로 명령을 보내고 제어기 피드백을 받는다 (명령 완료가 아니라 현재 상태).
- Parameters:
builder – rby1.RobotCommandBuilder (공식 타입).
timeout_ms – 피드백 대기(ms). 넘기면 공식 SDK 가 스트림을 취소한다.
- Returns:
rby1.RobotCommandFeedback (공식 타입).
- Raises:
RBY1Error – 스트림 만료·타임아웃·이전 명령 진행 중. RBY1ConnectionError 연결이 바뀜/끊김.
- wait(self: rb_sdk.rb_sdk_cpp.RBRby1CommandStreamSync, *, timeout_ms: int | None = None) bool#
스트림이 끝날(닫히거나 취소될) 때까지 기다린다.
- Parameters:
timeout_ms – 최대 대기(ms). None 이면 끝날 때까지.
- Returns:
끝났으면 True, 타임아웃이면 False.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- class rb_sdk.rb_sdk_cpp.RBRby1SDK(*args, **kwargs)#
Bases:
RBBaseSDKRainbow Robotics RB-Y1 SDK (공식 rby1-sdk C++ 위의 muscat SDK).
인스턴스는 얇은 핸들이고 로봇 gRPC 연결은 프로세스에 하나다 — 몇 번 생성해도 같은 연결을 쓴다. Python 에서 메서드는 기본 async (gRPC 대기를 C++ worker 스레드에서 GIL 없이),
sdk.sync.<method>는 동기. 로봇 연결은 connect_robot/disconnect_robot 이다 — RBBaseSDK.connect/disconnect 는 zenoh 원격 peer 등록.- approach_j(self, *, robot_model: str, target: dict[str, list[float]], controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1) Coroutine[Any, Any, bool]#
Approach J — move_j 와 같은 관절 이동을 시작만 하고 바로 돌아온다 (UI “이 자세로 이동” 용).
완료를 기다리지 않는다 (목표에 닿으면 로봇이 스스로 멈춘다). approach_stop 으로 중단한다. 진행 중 approach 가 있으면 먼저 취소하고 시작한다. 로봇이 거부하면 RBY1Error (사유 포함). 임피던스 컨트롤러는 유지 명령이라 허용하지 않는다 (position 만).
- Parameters:
robot_model – 연결된 model.
target – move_j 와 같음.
controllers – 부위별 컨트롤러 — “position” 만.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
- Returns:
True (명령을 보냈다).
- Raises:
ValueError – move_j 와 같음 + 임피던스 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- approach_l(self, *, robot_model: str, target: dict[str, list[float]], reference: str = 'base', controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1) Coroutine[Any, Any, bool]#
Approach L — move_l 과 같은 Cartesian 이동을 시작만 하고 바로 돌아온다. 규칙은 approach_j 와 같다.
- Parameters:
robot_model – 연결된 model.
target – move_l 과 같음.
reference – “base” 또는 “link_torso_5”.
controllers – 부위별 컨트롤러 — “position” 만.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
- Returns:
True (명령을 보냈다).
- Raises:
ValueError – move_l 과 같음 + 임피던스 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- approach_stop(self, *, robot_model: str) Coroutine[Any, Any, bool]#
진행 중인 approach 를 중단한다 (공식 Cancel, 끝날 때까지 최대 1.5s 대기). 없으면 아무것도 안 한다.
- Parameters:
robot_model – 연결된 model.
- Returns:
중단한 approach 가 있었으면 True.
- brake_engage(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
관절 브레이크를 건다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- brake_release(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
관절 브레이크를 푼다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- cancel_control(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
진행 중인 제어(명령)를 취소한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- cartesians_from_position(self, *, robot_model: str, position: list[float], reference: str = 'base') Coroutine[Any, Any, dict[str, list[float]]]#
관절값 → 손·T5 자세 (FK). gRPC 없이 캐시된 dynamics 모델로 계산한다 (20Hz 상태 콜백용).
- Parameters:
robot_model – 연결된 model.
position – 관절값 [rad], state.position 그대로.
reference – “base” (기본) 또는 “link_torso_5” — move_l / smoothjog_l 의 reference 와 같은 기준.
- Returns:
- {“torso”: pose, “right_arm”: pose, “left_arm”: pose} — Base
기준 link_torso_5 / ee_right / ee_left. link_torso_5: {“right_arm”: pose, “left_arm”: pose} — T5 기준 손 자세 (torso 자신은 항등이라 없음). pose = [x_mm, y_mm, z_mm, rx_deg, ry_deg, rz_deg] (R = Rz·Ry·Rx).
- Return type:
base
- Raises:
ValueError – position 길이가 DOF 와 다름, 모르는 reference. RBY1ConnectionError 미연결. RBY1Error model 불일치·모델 로드 실패.
- connect_robot(self, *, endpoint: str | None = None, model: str | None = None, max_retries: int = 5, timeout_ms: int = 1000) Coroutine[Any, Any, str]#
RB-Y1 gRPC 서버에 연결하고 로봇 model 을 확정한다.
이미 같은 endpoint(기본값 해석 후)·같은 model(생략 시 무관)로 연결돼 있고 채널이 살아 있으면 no-op — 연결과 스트림을 그대로 두고 연결된 model 을 반환한다. 그 밖에는 기존 연결·스트림을 끊고 새로 연결한다.
- Parameters:
endpoint – “host:port”. None 이면 환경변수 RBY1_HOST(없으면 192.168.30.1) + “:50051”.
model – “a” / “m” / “ub”. 주면 그 model 이 아닐 때 실패한다. 생략하면 로봇이 알려준 model.
max_retries – 연결 재시도 횟수.
timeout_ms – 시도당 타임아웃(ms).
- Returns:
연결된 model 이름 (“a” / “m” / “ub”).
- Raises:
RBY1ConnectionError – 연결 실패 또는 model 불일치.
- connect_wifi(self, *, robot_model: str, ssid: str, password: str = '', use_dhcp: bool = True, ip_address: str = '', gateway: str = '', dns: list[str] = [], flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
WiFi 네트워크에 연결한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
ssid – 네트워크 이름.
password – 비밀번호.
use_dhcp – DHCP 로 IP 를 받을지 여부.
ip_address – 고정 IP 주소 (use_dhcp=False 일 때).
gateway – 게이트웨이 주소.
dns – DNS 서버 목록.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- control(self, *, robot_model: str, callback: Callable[[Any], Any], port: int = 0, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
실시간(UDP) 제어 루프를 돈다 — 콜백이 finish=True 를 돌려줄 때까지 막힌다.
로봇이 보내는 상태 패킷마다 callback(state) 를 부르고 돌려준 입력을 로봇에 보낸다. 콜백은 제어 루프를 도는 스레드에서 불린다 (async: SDK worker 스레드, sync: 호출한 스레드) — 가볍게 유지해야 실시간성이 지켜진다. 콜백 예외는 제어를 끝내고(로봇 RT 명령 취소) 그 예외를 그대로 호출자에게 던진다. async 호출을 기다리던 쪽이 취소되면(Task.cancel, asyncio.wait_for 타임아웃, 루프 종료) 다음 상태 패킷에 콜백 없이 직전 입력(없으면 현재 위치 유지, gain 0)을 finish=True 로 보내 로봇이 제어를 끝낸다 — 이때 flow_manager_args.done() 은 부르지 않는다. sync 는 콜백의 finish 로만 끝난다. 실행 중 async control 은 SDK worker 4개 중 하나를 쓴다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
callback – callback(state) -> input — state 는 rby1.Robot_A_ControlState 등, input 은 같은 model 의 rby1.Robot_A_ControlInput 등 (공식 타입).
port – 로컬 UDP 포트. 0 이면 OS 가 고른다.
priority – RT 제어 명령 우선순위.
flow_manager_args – Optional PyFM step context. finish=True 로 끝나면 done() 을 호출한다.
- Returns:
True (finish=True 로 끝남).
- Raises:
RBY1Error – finish 없이 끝남(UDP bind 실패, 로봇 거부·선점·취소, 연결 끊김) 또는 호출 실패. RBY1ConnectionError 미연결. 콜백이 던진 예외는 그대로.
- create_command_stream(self, *, robot_model: str, priority: int = 1) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.RBRby1CommandStream]#
명령 스트림을 연다 (한 연결로 명령을 연이어 보낸다).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
priority – 스트림 우선순위 (첫 명령에 실린다).
- Returns:
RBRby1CommandStream.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- disable_control_manager(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
control manager 를 끈다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- disconnect_robot(self) Coroutine[Any, Any, bool]#
로봇 gRPC 연결을 끊는다 (스트림도 모두 멈춘다).
- Returns:
연결이 있었으면 true.
- disconnect_wifi(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
WiFi 연결을 끊는다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- download_file(self, *, robot_model: str, path: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bytes]#
로봇의 파일을 내려받는다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
path – 로봇 파일 경로 (RBY1_HOME 기준 상대 경로).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
파일 내용 (bytes).
- Raises:
RBY1Error – 파일 없음·로봇 에러·gRPC 실패. RBY1ConnectionError 미연결.
- emergency_stop(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, dict[str, bool]]#
비상 정지 — 모션 정지(priority 10) 후 무조건 전원 차단(power_off “.*”). 물리 EMO 와 별개인 SW 트리거.
정지가 실패해도 stderr 에 로그를 남기고 전원 차단은 반드시 시도한다 (최후 안전장치). 재개하려면 power_on + servo_on + enable_control_manager 가 다시 필요하다. await 가 취소돼도 끝까지 수행한다.
- Parameters:
robot_model – 연결된 model.
flow_manager_args – Optional PyFM step context. 끝나면 done() 을 호출한다.
- Returns:
bool} (power_off 결과).
- Return type:
{“stopped”
- Raises:
RBY1ConnectionError – 미연결. RBY1Error model 불일치·전원 차단 gRPC 실패.
- enable_control_manager(self, *, robot_model: str, unlimited_mode_enabled: bool = False, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
control manager 를 켠다. 로봇에 명령을 보내기 전에 불러야 한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
unlimited_mode_enabled – unlimited 모드 사용 여부.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- factory_reset_all_parameters(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, None]#
모든 파라미터를 공장 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- factory_reset_parameter(self, *, robot_model: str, name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
파라미터 하나를 공장 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- get_control_manager_state(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.ControlManagerState]#
control manager 상태를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.ControlManagerState (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_dynamics(self, *, robot_model: str, urdf_model: str = '', flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_24 | rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_26 | rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_18]#
로봇 동역학 모델을 만든다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
urdf_model – URDF 내용(경로가 아니다). 비우면 로봇에 저장된 모델(get_robot_model)을 쓴다.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.dynamics.Robot_24 / _26 / _18 (연결된 model 의 DOF, 공식 타입).
- Raises:
RBY1Error – 모델 조회·URDF 파싱 실패(관절 수 ≠ DOF 포함). RBY1ConnectionError 미연결.
- get_fault_log_list(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[str]]#
fault 로그 목록을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
fault 로그 항목 문자열 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_head_position_pid_gains(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]]#
머리 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_joint_limits(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, dict[str, dict[str, Any]]]#
관절 리밋 조회 (로봇 dynamics 모델). move_j 전 목표 검증용.
- Parameters:
robot_model – 연결된 model.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
{“position”: [lo, hi] rad, “velocity”: [lo, hi] rad/s, “acceleration”: [lo, hi] rad/s^2, “torque”: Nm}} (공식 dynamics 관절 순서).
- Return type:
{관절명
- Raises:
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·dynamics 모델 로드 실패.
- get_last_log(self, *, robot_model: str, count: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.Log]]#
최근 로그를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
count – 가져올 로그 개수.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.Log 목록 (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_left_arm_position_pid_gains(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]]#
왼팔 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_parameter(self, *, robot_model: str, name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, str]#
로봇 파라미터 값을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
파라미터 값 (문자열).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_parameter_list(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[tuple[str, int]]]#
파라미터 목록을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
(파라미터 이름, 타입) 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_position_pid_gain(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
특정 장치의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.PIDGain (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_right_arm_position_pid_gains(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]]#
오른팔 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_robot_info(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.RobotInfo]#
로봇 정보(model, 관절·장치 목록 등)를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.RobotInfo (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_robot_model(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, str]#
로봇에 저장된 로봇 모델(URDF) 문자열을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
로봇 모델 문자열.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_serial_device_list(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.SerialDevice]]#
로봇의 시리얼 장치 목록을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.SerialDevice 목록 (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_state(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.RobotState_A | rb_sdk.rb_sdk_cpp.rby1.RobotState_M | rb_sdk.rb_sdk_cpp.rby1.RobotState_UB]#
현재 로봇 상태를 한 번 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.RobotState_A / _M / _UB (연결된 model 의 공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_system_time(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, tuple[datetime.datetime, str]]#
로봇 시스템 시간을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
(datetime, local_time) — 로봇 타임존의 aware datetime 과 로봇의 로컬 시간 문자열 (공식 Python 바인딩과 같은 형태). 로봇이 타임존을 주지 않으면 datetime 은 UTC.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_time_scale(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, float]#
현재 모션 시간 배율(time scale)을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
현재 time scale (0.0~1.0).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_torso_position_pid_gains(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]]#
몸통(torso) 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- get_wifi_status(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.rby1.WifiStatus | None]#
WiFi 연결 상태를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.WifiStatus (공식 타입). 로봇이 에러 응답을 주면 None.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- has_established_time_sync(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
시간 동기화가 한 번이라도 성공했는지 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
동기화됐으면 True.
- Raises:
RBY1ConnectionError – 미연결.
- home_offset_reset(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치의 home offset 을 초기화한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- import_robot_model(self, *, robot_model: str, name: str, model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
로봇 모델(URDF)을 로봇에 등록한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 모델 이름.
model – 모델 데이터 (URDF 문자열).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- is_power_on(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치 전원이 켜져 있는지 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식. 매칭된 장치가 모두 켜져 있어야 True.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
매칭된 장치가 모두 켜져 있으면 True.
- Raises:
RBY1Error – 매칭 장치 없음 또는 호출 실패. RBY1ConnectionError 미연결.
- static is_robot_connected() bool#
로봇 gRPC 연결 여부 — 연결된 로봇이 있고 그 gRPC 채널이 살아 있는지 (공식 IsConnected, RPC 없음).
채널 상태는 gRPC 가 마지막으로 관찰한 것이다: 서버가 죽은 뒤 호출이 한 번 실패해야 false 가 되고, 채널이 스스로 재연결하면 다시 true 가 된다 (connect_robot 불필요).
- Returns:
연결돼 있으면 true.
- is_servo_on(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
관절 서보가 켜져 있는지 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
서보가 켜져 있으면 True.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static log_stream_stats(*, robot_model: str) dict[str, int]#
로그 스트림 통계 (멈춘 뒤에도 마지막 값).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”).
- Returns:
수신 batch 수, “delivered”: 콜백 호출 수, “dropped”: 대기열이 넘쳐 버린 batch 수, “resubscribes”: 끊긴 스트림을 다시 구독한 수}.
- Return type:
{“received”
- property model#
연결된 로봇 model.
- Returns:
“a” / “m” / “ub”, 미연결이면 None.
- move_j(self, *, robot_model: str, target: dict[str, list[float]], controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, dict[str, Any]]#
관절 이동 1회 — 컴포넌트별 목표 각도(deg) 로 이동하고 끝날 때까지 기다린다.
target 의 키가 곧 명령 부위. 컨트롤 매니저는 자동 복구한다. joint_impedance 는 minimum_time 유지 후 Ok. async await 가 취소되면 로봇 명령도 취소한다 (C++: rby1_rt::CancelScope::Enter).
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”/”head”) → 관절값 [deg], 컴포넌트 전체 길이.
controllers – 부위별 컨트롤러 (없으면 position). 팔: “position”/”joint_impedance”. torso·head: “position”.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
flow_manager_args – Optional PyFM step context. 정지면 로봇을 세우고 예외, 일시정지면 세웠다가 resume 뒤 남은 시간으로 재전송. 끝나면 done(). args[“variable”] 이 있으면 done 전에 그 이름의 변수에 끝난 자세 저장 (move_j: 부위별 관절 deg, move_l: reference 기준 pose — target 과 같은 형식).
- Returns:
bool, “finish_code”: str}. Ok 가 아니면 알림도 나간다.
- Return type:
{“finished”
- Raises:
ValueError – 빈 target, 모르는 컴포넌트, 길이 불일치, 유한수 아님, 허용 안 되는 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- move_l(self, *, robot_model: str, target: dict[str, list[float]], reference: str = 'base', controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, dict[str, Any]]#
Cartesian 이동 1회 — 손(ee_right/ee_left)·T5(link_torso_5) 자세로 이동하고 끝날 때까지 기다린다.
IK 는 로봇이 푼다. 나머지 규칙은 move_j 와 같다.
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”) → [x_mm, y_mm, z_mm, rx_deg, ry_deg, rz_deg] (R = Rz·Ry·Rx). torso 는 Base 기준, 손은 reference 기준.
reference – “base” 또는 “link_torso_5” (손 목표의 기준 — cartesians_from_position(reference) 와 같은 좌표).
controllers – 부위별 컨트롤러. 팔: “position”/”cartesian_impedance”/”impedance”. torso: “position”.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
flow_manager_args – move_j 와 같다.
- Returns:
bool, “finish_code”: str}.
- Return type:
{“finished”
- Raises:
ValueError – 빈 target, 모르는 컴포넌트·키, reference 오류, 유한수 아님, 허용 안 되는 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- open_serial_stream(self, *, robot_model: str, device_path: str, baudrate: int, bytesize: int = 8, parity: str = 'N', stopbits: int = 1, callback: Callable[[bytes], Any] | None = None) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.RBRby1SerialStream]#
로봇의 시리얼 장치 스트림을 연다 (장치는 반환된 스트림의 connect() 로 연다).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
device_path – 장치 경로 (get_serial_device_list 의 path).
baudrate – 보드레이트.
bytesize – 데이터 비트 수.
parity – 패리티 (‘N’ / ‘E’ / ‘O’).
stopbits – 스톱 비트 수.
callback – callback(data: bytes) — 받은 데이터. 수신 전용 스레드에서 순서대로 불린다. None 이면 받지 않는다.
- Returns:
RBRby1SerialStream.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- power_off(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치 전원을 끈다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식 (예: “.*” 전체).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- power_on(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치 전원을 켠다. 켜진 장치는 건드리지 않고 꺼진 장치만 모아 한 번에 켠다 — 전부 켜져 있으면 아무것도 안 보내고 True.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식 (예: “.*” 전체, “^right_arm_.*”).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- reset_all_parameters(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, None]#
모든 파라미터를 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- reset_battery_config(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
배터리 설정을 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- reset_fault_control_manager(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
control manager 의 fault 를 해제한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- reset_network_setting(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
네트워크 설정을 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- reset_odometry(self, *, robot_model: str, angle: float, position: numpy.ndarray[numpy.float64[2, 1]], flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
오도메트리를 주어진 값으로 초기화한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
angle – 새 각도 [rad].
position – 새 위치 [x, y] [m].
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- reset_parameter(self, *, robot_model: str, name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
파라미터 하나를 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- scan_wifi(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, list[rb_sdk.rb_sdk_cpp.rby1.WifiNetwork]]#
주변 WiFi 네트워크를 검색한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.WifiNetwork 목록 (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- send_command(self, *, robot_model: str, builder: rb_sdk_cpp.rby1.RobotCommandBuilder, priority: int = 1) Coroutine[Any, Any, rb_sdk.rb_sdk_cpp.RBRby1CommandHandle]#
로봇 명령을 보낸다 (수락까지만 — 완료는 핸들의 wait/get 으로 기다린다).
명령 완료가 PyFM step 완료이므로 flow_manager_args 는 핸들의 wait/get 에 넘긴다. 반환된 핸들을 버리면 명령이 취소된다 (공식 핸들 소멸자). await 가 실행 전에 취소되면 명령은 보내지 않는다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
builder – rby1.RobotCommandBuilder (공식 타입).
priority – 명령 우선순위 (높을수록 우선).
- Returns:
RBRby1CommandHandle.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- servo_off(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
관절 서보를 끈다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식 (예: “.*” 전체).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- servo_on(self, *, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
관절 서보를 켠다. 켜진 관절(is_ready)은 건드리지 않고 꺼진 관절만 모아 한 번에 켠다 — 전부 켜져 있으면 아무것도 안 보내고 True.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식 (예: “.*” 전체, “^torso_.*”).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_battery_config(self, *, robot_model: str, cutoff_voltage: float, fully_charged_voltage: float, coefficients: Annotated[list[float], FixedSize(4)], flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
배터리 설정을 바꾼다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
cutoff_voltage – 차단 전압 [V].
fully_charged_voltage – 완충 전압 [V].
coefficients – 배터리 계수 4개.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_battery_level(self, *, robot_model: str, level: float, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
배터리 잔량을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
level – 배터리 잔량 [%] (0.0~100.0).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_led_color(self, *, robot_model: str, color: rb_sdk.rb_sdk_cpp.rby1.Color, duration: float = 1.0, transition_time: float = 0.0, blinking: bool = False, blinking_freq: float = 1.0, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
LED 색을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
color – rby1.Color (공식 타입, RGB 0~255).
duration – 유지 시간 [s].
transition_time – 전환 시간 [s].
blinking – 깜빡임 여부.
blinking_freq – 깜빡임 주파수 [Hz].
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_parameter(self, *, robot_model: str, name: str, value: str, write_db: bool = True, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
로봇 파라미터 값을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
value – 파라미터 값 (문자열).
write_db – DB 에도 기록할지 여부.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 해당 파라미터가 없거나 호출 실패. RBY1ConnectionError 미연결.
- set_position_d_gain(self, *, robot_model: str, dev_name: str, d_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치의 위치 제어 D 게인을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
d_gain – D 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_position_i_gain(self, *, robot_model: str, dev_name: str, i_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치의 위치 제어 I 게인을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
i_gain – I 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_position_p_gain(self, *, robot_model: str, dev_name: str, p_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치의 위치 제어 P 게인을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
p_gain – P 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_position_pid_gain(self, *, robot_model: str, dev_name: str, p_gain: int, i_gain: int, d_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치의 위치 제어 P/I/D 게인을 한 번에 설정한다. PIDGain 객체로 주려면 set_position_pid_gain_object.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
p_gain – P 게인 (0~65535).
i_gain – I 게인 (0~65535).
d_gain – D 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_position_pid_gain_object(self, *, robot_model: str, dev_name: str, pid_gain: rb_sdk.rb_sdk_cpp.rby1.PIDGain, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
장치의 위치 제어 PID 게인을 PIDGain 객체로 설정한다 (공식 SetPositionPIDGain 의 PIDGain 오버로드).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
pid_gain – rby1.PIDGain (공식 타입).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_preset_position(self, *, robot_model: str, joint_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
관절의 preset 위치를 설정한다 (PVL 계열 모터만 지원).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
joint_name – 관절 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_system_time(self, *, robot_model: str, utc_time: datetime.datetime, time_zone: str | None = None, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
로봇 시스템 시간을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
utc_time – 새 시간 (Python datetime.datetime; naive 면 로컬 시간으로 해석).
time_zone – 로봇 타임존 (예: “Asia/Seoul”). None 이면 타임존은 바꾸지 않는다.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_time_scale(self, *, robot_model: str, time_scale: float, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, float]#
모션 실행 시간 배율을 설정한다. 0.0 은 정지, 1.0 은 최대 속도.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
time_scale – 설정할 time scale (0.0~1.0).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
로봇에 실제 적용된 time scale.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- set_tool_flange_digital_output(self, *, robot_model: str, name: str, channel: int, state: bool, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
툴 플랜지 디지털 출력 한 채널의 상태를 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 팔 이름 (“right” / “left”).
channel – 디지털 출력 채널 번호.
state – True = ON, False = OFF.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_tool_flange_digital_output_dual(self, *, robot_model: str, name: str, state_0: bool, state_1: bool, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
툴 플랜지 디지털 출력 채널 0/1 의 상태를 동시에 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 팔 이름 (“right” / “left”).
state_0 – 채널 0 상태 (True = ON).
state_1 – 채널 1 상태 (True = ON).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- set_tool_flange_output_voltage(self, *, robot_model: str, name: str, voltage: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
툴 플랜지 출력 전압을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 툴 플랜지 이름 (“right” / “left”).
voltage – 출력 전압 [V]. 보통 12 / 24, 0 이면 출력 끔.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static smooth_status(*, robot_model: str) str#
Smooth jog 상태 — “start”(정지 처리 중 포함) 또는 “stop”.
- Parameters:
robot_model – 연결된 model.
- Returns:
“start” 또는 “stop”.
- smoothjog_j(self, *, robot_model: str, target: dict[str, list[float]]) Coroutine[Any, Any, dict[str, list[float]]]#
Smooth J heartbeat — 관절 목표를 따라 연속 이동한다. 세션·정지 규칙은 smoothjog_l 과 같다.
호출마다 JointPositionCommand 1개 (minimum_time 0.15s, 10°/s, 30°/s²). 1회 변화량은 관절별 0.5° 이하.
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”/”head”) → 관절값 [deg], 컴포넌트 전체 길이. 비어 있으면 안 된다.
- Returns:
받아들인 목표 (target 과 같음).
- Raises:
ValueError – 키·길이 오류, 유한수 아님, 빈 target.
RBY1ConnectionError – 미연결. RBY1Error 변화량 초과·로봇 busy·컨트롤러 거부·gRPC 실패.
- smoothjog_l(self, *, robot_model: str, target: dict[str, list[float]], reference: str = 'base') Coroutine[Any, Any, dict[str, list[float]]]#
Smooth L heartbeat — 손(및 T5) Cartesian 목표를 따라 연속 이동한다.
버튼을 누르는 동안 약 20Hz 로 부른다. 세션이 없으면 시작하고(스트림 1개, smooth_status “start”), 호출마다 CartesianCommand 1개를 보낸다 (minimum_time 0.15s, hold 0.5s). 250ms 동안 heartbeat 가 없으면 스스로 정지한다. target 의 키가 곧 명령에 넣는 부위. 1회 변화량은 위치 1.5mm·회전 0.35° 이하 (이전 목표 기준, 처음 오는 부위는 현재 FK 기준) — 넘으면 정지 + 예외. 세션 중 L/J·reference 변경도 정지 + 예외.
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”) → [x_mm, y_mm, z_mm, rx_deg, ry_deg, rz_deg]. 비어 있으면 안 된다.
reference – “base” 또는 “link_torso_5”.
- Returns:
받아들인 목표 (target 과 같음).
- Raises:
ValueError – reference·키·길이 오류, 유한수 아님, 빈 target.
RBY1ConnectionError – 미연결. RBY1Error 변화량 초과·로봇 busy·컨트롤러 거부·gRPC 실패.
- smoothjog_stop(self, *, robot_model: str, reason: str = 'user') Coroutine[Any, Any, bool]#
Smooth jog 정지 (L/J 공용). 스트림 취소 → cancel_control → Idle 대기(최대 1.5s) → smooth_status “stop”.
- Parameters:
robot_model – 연결된 model.
reason – 로그용 정지 사유.
- Returns:
정지한 세션이 있었으면 True.
- start_log_stream(self, *, robot_model: str, callback: Callable[[list], Any], rate: float) Coroutine[Any, Any, None]#
로봇 로그 스트림을 시작한다 (유실 최소화 대기열).
콜백은 스트림 전용 스레드에서 받은 순서대로 한 번에 하나씩 불린다. 콜백이 느려도 gRPC 수신은 막히지 않고 1024 batch 까지 쌓이며, 넘치면 가장 오래된 것부터 버린다 (log_stream_stats 의 dropped). 콜백이 awaitable(코루틴 등)을 돌려주면 등록 시점의 실행 중 이벤트 루프에서 실행하고 끝날 때까지 다음 batch 를 넘기지 않는다. 코루틴 함수를 이벤트 루프 밖에서 등록하면 RuntimeError. 콜백 예외는 stderr 로 출력하고 스트림은 계속된다. 같은 model 로 다시 부르면 이전 스트림을 멈추고 새로 시작한다. disconnect_robot 은 스트림을 멈춘다. 콜백 안에서 stop_log_stream 을 불러도 된다. 끊김 복구는 start_state_update 와 같다 (max(10/rate, 1)초 동안 수신이 없으면 다시 구독, log_stream_stats 의 resubscribes).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
callback – callback(logs) — logs 는 rby1.Log 목록 (공식 스트림 콜백 1회분).
rate – 요청 수신 주기(Hz).
- Raises:
RBY1Error – model 불일치. RBY1ConnectionError 미연결.
- start_state_update(self, *, robot_model: str, callback: Callable[..., Any], rate: float) Coroutine[Any, Any, None]#
로봇 상태 스트림을 시작한다 (latest-only).
공식 start_state_update 와 같이 콜백 인자는 1개 또는 2개다: callback(state) 또는 callback(state, control_manager_state). 개수는 등록 때 한 번 inspect.signature(callback).parameters 로 센다 (bound method 의 self, partial 로 묶인 인자는 빠진다). 그 밖의 개수면 TypeError. 두 값은 같은 스트림 샘플 (GetRobotStateStream 응답 하나)에서 온다 — 1개 형도 같은 RPC 이므로 비용 차이는 없다.
콜백은 스트림 전용 스레드에서 한 번에 하나씩 불린다. 콜백이 느리면 그 사이 도착한 상태는 최신 것만 남고 나머지는 버린다 (gRPC 수신은 막히지 않는다). 콜백이 awaitable(코루틴 등)을 돌려주면 등록 시점의 실행 중 이벤트 루프에서 실행하고 끝날 때까지 다음 상태를 넘기지 않는다 (코루틴도 latest-only). 코루틴 함수를 이벤트 루프 밖에서 등록하면 RuntimeError, 그 밖의 콜백이 루프 없이 awaitable 을 돌려주면 에러 로그 후 그 상태를 버린다. 콜백 예외는 stderr 로 출력하고 스트림은 계속된다. 같은 model 로 다시 부르면 이전 스트림을 멈추고 새로 시작한다. 콜백 안에서 stop_state_update 를 불러도 된다.
끊김 복구: 공식 SDK 는 서버가 스트림을 끝내도 알리지 않으므로, max(10/rate, 1)초 동안 상태가 안 오면 다시 구독한다 (stderr 에 끊김·복구 한 줄씩, 재시도 간격은 두 배씩 4배까지, state_update_stats 의 resubscribes). gRPC 연결은 공식 채널이 스스로 다시 맺으므로 로봇이 돌아오면 connect_robot 없이 스트림이 이어진다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
callback – callback(state) 또는 callback(state, control_manager_state) — state 는 rby1.RobotState_A / _M / _UB, control_manager_state 는 rby1.ControlManagerState (공식 타입).
rate – 요청 수신 주기(Hz).
- Raises:
RBY1Error – model 불일치. RBY1ConnectionError 미연결. TypeError 콜백 인자 개수가 1·2 가 아님.
- static state_update_stats(*, robot_model: str) dict[str, int]#
상태 스트림 통계 (멈춘 뒤에도 마지막 값).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”).
- Returns:
수신 수, “delivered”: 콜백 호출 수, “dropped”: 콜백 전에 새 상태로 덮여 버린 수, “resubscribes”: 끊긴 스트림을 다시 구독한 수}.
- Return type:
{“received”
- stop(self, *, robot_model: str, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, dict[str, Any]]#
모션 정지 — StopCommand(whole body) 를 보내고 끝날 때까지 기다린다.
finish_code 가 Ok 가 아니면 예외 대신 그대로 반환하고, muscat/{robot_model}/message 로 ERROR 알림 (
RBY1 Move Error: <code>, 사유는 로봇 마지막 로그)을 보낸다. 정지 명령이라 await 가 취소돼도 명령은 취소하지 않는다 (끝날 때까지 기다리고 done() 만 막는다).- Parameters:
robot_model – 연결된 model (“a” / “m” / “ub”).
priority – 명령 우선순위. 진행 중인 명령보다 확실히 우선하려면 높게.
flow_manager_args – Optional PyFM step context. 명령이 끝나면 done() 을 호출한다.
- Returns:
bool, “finish_code”: str}.
- Return type:
{“finished”
- Raises:
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패.
- stop_log_stream(self, *, robot_model: str) Coroutine[Any, Any, bool]#
로그 스트림을 멈춘다. 진행 중인 동기 콜백이 끝날 때까지 기다리고 (콜백 안에서 부르면 기다리지 않는다), 진행 중인 코루틴 콜백은 취소한다. 아직 콜백에 넘기지 못한 로그는 버린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”).
- Returns:
동작 중이던 스트림이 있었으면 True.
- stop_state_update(self, *, robot_model: str) Coroutine[Any, Any, bool]#
상태 스트림을 멈춘다. 진행 중인 동기 콜백이 끝날 때까지 기다리고 (콜백 안에서 부르면 기다리지 않는다), 진행 중인 코루틴 콜백은 취소한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”).
- Returns:
동작 중이던 스트림이 있었으면 True.
- property sync#
동기 호출 뷰 (PyFM step/스크립트용).
- sync_time(self, *, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
로봇과 시간 동기화를 한 번 한다 (Ping 왕복으로 로봇 시계 오프셋 추정 — 이후 RobotState/Log 의 timestamp 가 로컬 시계 기준으로 보정된다).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇 응답에 시각이 없음 또는 호출 실패. RBY1ConnectionError 미연결.
- wait_for_control_ready(self, *, robot_model: str, timeout_ms: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) Coroutine[Any, Any, bool]#
로봇이 제어 명령을 받을 준비가 될 때까지 기다린다. servo_on 뒤, 명령 전에 부른다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
timeout_ms – 타임아웃 [ms].
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
준비됐으면 True, 타임아웃이면 False (예외 아님).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- class rb_sdk.rb_sdk_cpp.RBRby1SerialStream#
Bases:
pybind11_object로봇 시리얼 장치 스트림 (RBRby1SDK.open_serial_stream 결과, 공식 SerialStream 래퍼).
connect() 후 write() 로 보내고, 받은 데이터는 open_serial_stream 의 callback(data: bytes) 으로 온다. 콜백은 수신 전용 스레드에서 순서대로 한 번에 하나씩 불린다 (gRPC 수신은 막히지 않는다 — 콜백이 느리면 1024 chunk 까지 쌓고, 넘치면 오래된 것부터 버린다: read_stats 의 dropped). 콜백이 awaitable 을 돌려주면 등록 시점의 이벤트 루프에서 실행하고 끝날 때까지 다음 chunk 를 넘기지 않는다. 콜백 예외는 stderr 로 출력한다. 블로킹 메서드는 기본 async,
stream.sync.<method>는 동기다. async 호출을 기다리던 쪽이 취소되면 스트림을 끊는다 (cancel()). 핸들을 버리면 스트림이 끊긴다 (공식 소멸자). disconnect_robot / connect_robot 뒤에는 connect/write 를 보내지 않는다 (RBY1ConnectionError).- cancel(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStream) None#
스트림을 끊는다 (진행 중인 콜백은 기다리지 않는다, 넘기지 못한 수신 데이터는 버린다). fork 로 버려진 핸들이면 아무것도 하지 않는다.
- connect(self, *, verbose: bool = False) Coroutine[Any, Any, bool]#
시리얼 장치를 연다 (open_serial_stream 의 설정으로).
- Parameters:
verbose – 실패 이유를 stderr 로 출력 (공식 SDK).
- Returns:
True.
- Raises:
RBY1Error – 열기 실패(이미 열림·끊긴 스트림·로봇 거부·타임아웃). RBY1ConnectionError 연결이 바뀜/끊김.
- disconnect(self) Coroutine[Any, Any, None]#
스트림을 끊고 진행 중인 수신 콜백이 끝날 때까지 기다린다 — 반환 뒤로 콜백은 없다 (아직 콜백에 넘기지 못한 수신 데이터는 버린다. 콜백 안에서 부르면 기다리지 않는다).
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- is_done(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStream) bool#
스트림이 끝났는지.
- Returns:
끝났으면 True.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- is_opened(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStream) bool#
장치가 열려 있는지 (공식 SDK: connect 성공 뒤 True).
- Returns:
열려 있으면 True.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- read_stats(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStream) dict[str, int]#
수신 콜백 통계.
- Returns:
받은 chunk 수, “delivered”: 콜백 호출 수, “dropped”: 대기열이 넘쳐 버린 수}. 콜백 없이 열었으면 모두 0.
- Return type:
{“received”
- property sync#
동기 호출 뷰 (PyFM step/스크립트용).
- wait(self, *, timeout_ms: int | None = None) Coroutine[Any, Any, bool]#
스트림이 끝날(끊기거나 취소될) 때까지 기다린다.
- Parameters:
timeout_ms – 최대 대기(ms). None 이면 끝날 때까지.
- Returns:
끝났으면 True, 타임아웃이면 False.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- class rb_sdk.rb_sdk_cpp.RBRby1SerialStreamSync#
Bases:
pybind11_object핸들의 동기 호출 뷰 (handle.sync). GIL 을 풀고 호출 스레드에서 기다린다.
- connect(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStreamSync, *, verbose: bool = False) bool#
시리얼 장치를 연다 (open_serial_stream 의 설정으로).
- Parameters:
verbose – 실패 이유를 stderr 로 출력 (공식 SDK).
- Returns:
True.
- Raises:
RBY1Error – 열기 실패(이미 열림·끊긴 스트림·로봇 거부·타임아웃). RBY1ConnectionError 연결이 바뀜/끊김.
- disconnect(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStreamSync) None#
스트림을 끊고 진행 중인 수신 콜백이 끝날 때까지 기다린다 — 반환 뒤로 콜백은 없다 (아직 콜백에 넘기지 못한 수신 데이터는 버린다. 콜백 안에서 부르면 기다리지 않는다).
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- wait(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStreamSync, *, timeout_ms: int | None = None) bool#
스트림이 끝날(끊기거나 취소될) 때까지 기다린다.
- Parameters:
timeout_ms – 최대 대기(ms). None 이면 끝날 때까지.
- Returns:
끝났으면 True, 타임아웃이면 False.
- Raises:
RBY1ConnectionError – fork 자식에서 부모 핸들 사용.
- write(self: rb_sdk.rb_sdk_cpp.RBRby1SerialStreamSync, *, data: str) bool#
데이터를 보낸다.
- Parameters:
data – 보낼 bytes (str 이면 UTF-8).
- Returns:
True.
- Raises:
RBY1Error – 쓰기 실패(열리지 않음·끊김·타임아웃). RBY1ConnectionError 연결이 바뀜/끊김.
- class rb_sdk.rb_sdk_cpp.RBRby1SyncSDK#
Bases:
pybind11_objectRBRby1SDK 의 동기 호출 뷰 (sdk.sync). GIL 을 풀고 호출 스레드에서 gRPC 를 기다린다.
- static approach_j(*, robot_model: str, target: dict[str, list[float]], controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1) bool#
Approach J — move_j 와 같은 관절 이동을 시작만 하고 바로 돌아온다 (UI “이 자세로 이동” 용).
완료를 기다리지 않는다 (목표에 닿으면 로봇이 스스로 멈춘다). approach_stop 으로 중단한다. 진행 중 approach 가 있으면 먼저 취소하고 시작한다. 로봇이 거부하면 RBY1Error (사유 포함). 임피던스 컨트롤러는 유지 명령이라 허용하지 않는다 (position 만).
- Parameters:
robot_model – 연결된 model.
target – move_j 와 같음.
controllers – 부위별 컨트롤러 — “position” 만.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
- Returns:
True (명령을 보냈다).
- Raises:
ValueError – move_j 와 같음 + 임피던스 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- static approach_l(*, robot_model: str, target: dict[str, list[float]], reference: str = 'base', controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1) bool#
Approach L — move_l 과 같은 Cartesian 이동을 시작만 하고 바로 돌아온다. 규칙은 approach_j 와 같다.
- Parameters:
robot_model – 연결된 model.
target – move_l 과 같음.
reference – “base” 또는 “link_torso_5”.
controllers – 부위별 컨트롤러 — “position” 만.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
- Returns:
True (명령을 보냈다).
- Raises:
ValueError – move_l 과 같음 + 임피던스 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- static approach_stop(*, robot_model: str) bool#
진행 중인 approach 를 중단한다 (공식 Cancel, 끝날 때까지 최대 1.5s 대기). 없으면 아무것도 안 한다.
- Parameters:
robot_model – 연결된 model.
- Returns:
중단한 approach 가 있었으면 True.
- static brake_engage(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
관절 브레이크를 건다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static brake_release(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
관절 브레이크를 푼다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static cancel_control(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
진행 중인 제어(명령)를 취소한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static cartesians_from_position(*, robot_model: str, position: list[float], reference: str = 'base') dict[str, list[float]]#
관절값 → 손·T5 자세 (FK). gRPC 없이 캐시된 dynamics 모델로 계산한다 (20Hz 상태 콜백용).
- Parameters:
robot_model – 연결된 model.
position – 관절값 [rad], state.position 그대로.
reference – “base” (기본) 또는 “link_torso_5” — move_l / smoothjog_l 의 reference 와 같은 기준.
- Returns:
- {“torso”: pose, “right_arm”: pose, “left_arm”: pose} — Base
기준 link_torso_5 / ee_right / ee_left. link_torso_5: {“right_arm”: pose, “left_arm”: pose} — T5 기준 손 자세 (torso 자신은 항등이라 없음). pose = [x_mm, y_mm, z_mm, rx_deg, ry_deg, rz_deg] (R = Rz·Ry·Rx).
- Return type:
base
- Raises:
ValueError – position 길이가 DOF 와 다름, 모르는 reference. RBY1ConnectionError 미연결. RBY1Error model 불일치·모델 로드 실패.
- static connect_robot(*, endpoint: str | None = None, model: str | None = None, max_retries: int = 5, timeout_ms: int = 1000) str#
RB-Y1 gRPC 서버에 연결하고 로봇 model 을 확정한다.
이미 같은 endpoint(기본값 해석 후)·같은 model(생략 시 무관)로 연결돼 있고 채널이 살아 있으면 no-op — 연결과 스트림을 그대로 두고 연결된 model 을 반환한다. 그 밖에는 기존 연결·스트림을 끊고 새로 연결한다.
- Parameters:
endpoint – “host:port”. None 이면 환경변수 RBY1_HOST(없으면 192.168.30.1) + “:50051”.
model – “a” / “m” / “ub”. 주면 그 model 이 아닐 때 실패한다. 생략하면 로봇이 알려준 model.
max_retries – 연결 재시도 횟수.
timeout_ms – 시도당 타임아웃(ms).
- Returns:
연결된 model 이름 (“a” / “m” / “ub”).
- Raises:
RBY1ConnectionError – 연결 실패 또는 model 불일치.
- static connect_wifi(*, robot_model: str, ssid: str, password: str = '', use_dhcp: bool = True, ip_address: str = '', gateway: str = '', dns: list[str] = [], flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
WiFi 네트워크에 연결한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
ssid – 네트워크 이름.
password – 비밀번호.
use_dhcp – DHCP 로 IP 를 받을지 여부.
ip_address – 고정 IP 주소 (use_dhcp=False 일 때).
gateway – 게이트웨이 주소.
dns – DNS 서버 목록.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static control(*, robot_model: str, callback: Callable[[Any], Any], port: int = 0, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
실시간(UDP) 제어 루프를 돈다 — 콜백이 finish=True 를 돌려줄 때까지 막힌다.
로봇이 보내는 상태 패킷마다 callback(state) 를 부르고 돌려준 입력을 로봇에 보낸다. 콜백은 제어 루프를 도는 스레드에서 불린다 (async: SDK worker 스레드, sync: 호출한 스레드) — 가볍게 유지해야 실시간성이 지켜진다. 콜백 예외는 제어를 끝내고(로봇 RT 명령 취소) 그 예외를 그대로 호출자에게 던진다. async 호출을 기다리던 쪽이 취소되면(Task.cancel, asyncio.wait_for 타임아웃, 루프 종료) 다음 상태 패킷에 콜백 없이 직전 입력(없으면 현재 위치 유지, gain 0)을 finish=True 로 보내 로봇이 제어를 끝낸다 — 이때 flow_manager_args.done() 은 부르지 않는다. sync 는 콜백의 finish 로만 끝난다. 실행 중 async control 은 SDK worker 4개 중 하나를 쓴다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
callback – callback(state) -> input — state 는 rby1.Robot_A_ControlState 등, input 은 같은 model 의 rby1.Robot_A_ControlInput 등 (공식 타입).
port – 로컬 UDP 포트. 0 이면 OS 가 고른다.
priority – RT 제어 명령 우선순위.
flow_manager_args – Optional PyFM step context. finish=True 로 끝나면 done() 을 호출한다.
- Returns:
True (finish=True 로 끝남).
- Raises:
RBY1Error – finish 없이 끝남(UDP bind 실패, 로봇 거부·선점·취소, 연결 끊김) 또는 호출 실패. RBY1ConnectionError 미연결. 콜백이 던진 예외는 그대로.
- static create_command_stream(*, robot_model: str, priority: int = 1) rb_sdk.rb_sdk_cpp.RBRby1CommandStream#
명령 스트림을 연다 (한 연결로 명령을 연이어 보낸다).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
priority – 스트림 우선순위 (첫 명령에 실린다).
- Returns:
RBRby1CommandStream.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static disable_control_manager(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
control manager 를 끈다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static disconnect_robot() bool#
로봇 gRPC 연결을 끊는다 (스트림도 모두 멈춘다).
- Returns:
연결이 있었으면 true.
- static disconnect_wifi(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
WiFi 연결을 끊는다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static download_file(*, robot_model: str, path: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bytes#
로봇의 파일을 내려받는다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
path – 로봇 파일 경로 (RBY1_HOME 기준 상대 경로).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
파일 내용 (bytes).
- Raises:
RBY1Error – 파일 없음·로봇 에러·gRPC 실패. RBY1ConnectionError 미연결.
- static emergency_stop(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) dict[str, bool]#
비상 정지 — 모션 정지(priority 10) 후 무조건 전원 차단(power_off “.*”). 물리 EMO 와 별개인 SW 트리거.
정지가 실패해도 stderr 에 로그를 남기고 전원 차단은 반드시 시도한다 (최후 안전장치). 재개하려면 power_on + servo_on + enable_control_manager 가 다시 필요하다. await 가 취소돼도 끝까지 수행한다.
- Parameters:
robot_model – 연결된 model.
flow_manager_args – Optional PyFM step context. 끝나면 done() 을 호출한다.
- Returns:
bool} (power_off 결과).
- Return type:
{“stopped”
- Raises:
RBY1ConnectionError – 미연결. RBY1Error model 불일치·전원 차단 gRPC 실패.
- static enable_control_manager(*, robot_model: str, unlimited_mode_enabled: bool = False, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
control manager 를 켠다. 로봇에 명령을 보내기 전에 불러야 한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
unlimited_mode_enabled – unlimited 모드 사용 여부.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static factory_reset_all_parameters(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) None#
모든 파라미터를 공장 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static factory_reset_parameter(*, robot_model: str, name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
파라미터 하나를 공장 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static get_control_manager_state(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.ControlManagerState#
control manager 상태를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.ControlManagerState (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_dynamics(*, robot_model: str, urdf_model: str = '', flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_24 | rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_26 | rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_18#
로봇 동역학 모델을 만든다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
urdf_model – URDF 내용(경로가 아니다). 비우면 로봇에 저장된 모델(get_robot_model)을 쓴다.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.dynamics.Robot_24 / _26 / _18 (연결된 model 의 DOF, 공식 타입).
- Raises:
RBY1Error – 모델 조회·URDF 파싱 실패(관절 수 ≠ DOF 포함). RBY1ConnectionError 미연결.
- static get_fault_log_list(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[str]#
fault 로그 목록을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
fault 로그 항목 문자열 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_head_position_pid_gains(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
머리 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_joint_limits(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) dict[str, dict[str, Any]]#
관절 리밋 조회 (로봇 dynamics 모델). move_j 전 목표 검증용.
- Parameters:
robot_model – 연결된 model.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
{“position”: [lo, hi] rad, “velocity”: [lo, hi] rad/s, “acceleration”: [lo, hi] rad/s^2, “torque”: Nm}} (공식 dynamics 관절 순서).
- Return type:
{관절명
- Raises:
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·dynamics 모델 로드 실패.
- static get_last_log(*, robot_model: str, count: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.Log]#
최근 로그를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
count – 가져올 로그 개수.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.Log 목록 (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_left_arm_position_pid_gains(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
왼팔 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_parameter(*, robot_model: str, name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) str#
로봇 파라미터 값을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
파라미터 값 (문자열).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_parameter_list(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[tuple[str, int]]#
파라미터 목록을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
(파라미터 이름, 타입) 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_position_pid_gain(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.PIDGain#
특정 장치의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.PIDGain (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_right_arm_position_pid_gains(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
오른팔 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_robot_info(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.RobotInfo#
로봇 정보(model, 관절·장치 목록 등)를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.RobotInfo (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_robot_model(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) str#
로봇에 저장된 로봇 모델(URDF) 문자열을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
로봇 모델 문자열.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_serial_device_list(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.SerialDevice]#
로봇의 시리얼 장치 목록을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.SerialDevice 목록 (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_state(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.RobotState_A | rb_sdk.rb_sdk_cpp.rby1.RobotState_M | rb_sdk.rb_sdk_cpp.rby1.RobotState_UB#
현재 로봇 상태를 한 번 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.RobotState_A / _M / _UB (연결된 model 의 공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_system_time(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) tuple[datetime.datetime, str]#
로봇 시스템 시간을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
(datetime, local_time) — 로봇 타임존의 aware datetime 과 로봇의 로컬 시간 문자열 (공식 Python 바인딩과 같은 형태). 로봇이 타임존을 주지 않으면 datetime 은 UTC.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_time_scale(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) float#
현재 모션 시간 배율(time scale)을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
현재 time scale (0.0~1.0).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_torso_position_pid_gains(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
몸통(torso) 관절들의 위치 제어 PID 게인을 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
관절별 rby1.PIDGain 목록.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static get_wifi_status(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) rb_sdk.rb_sdk_cpp.rby1.WifiStatus | None#
WiFi 연결 상태를 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.WifiStatus (공식 타입). 로봇이 에러 응답을 주면 None.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static has_established_time_sync(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
시간 동기화가 한 번이라도 성공했는지 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
동기화됐으면 True.
- Raises:
RBY1ConnectionError – 미연결.
- static home_offset_reset(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치의 home offset 을 초기화한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static import_robot_model(*, robot_model: str, name: str, model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
로봇 모델(URDF)을 로봇에 등록한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 모델 이름.
model – 모델 데이터 (URDF 문자열).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static is_power_on(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치 전원이 켜져 있는지 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식. 매칭된 장치가 모두 켜져 있어야 True.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
매칭된 장치가 모두 켜져 있으면 True.
- Raises:
RBY1Error – 매칭 장치 없음 또는 호출 실패. RBY1ConnectionError 미연결.
- static is_servo_on(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
관절 서보가 켜져 있는지 조회한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
서보가 켜져 있으면 True.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static move_j(*, robot_model: str, target: dict[str, list[float]], controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) dict[str, Any]#
관절 이동 1회 — 컴포넌트별 목표 각도(deg) 로 이동하고 끝날 때까지 기다린다.
target 의 키가 곧 명령 부위. 컨트롤 매니저는 자동 복구한다. joint_impedance 는 minimum_time 유지 후 Ok. async await 가 취소되면 로봇 명령도 취소한다 (C++: rby1_rt::CancelScope::Enter).
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”/”head”) → 관절값 [deg], 컴포넌트 전체 길이.
controllers – 부위별 컨트롤러 (없으면 position). 팔: “position”/”joint_impedance”. torso·head: “position”.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
flow_manager_args – Optional PyFM step context. 정지면 로봇을 세우고 예외, 일시정지면 세웠다가 resume 뒤 남은 시간으로 재전송. 끝나면 done(). args[“variable”] 이 있으면 done 전에 그 이름의 변수에 끝난 자세 저장 (move_j: 부위별 관절 deg, move_l: reference 기준 pose — target 과 같은 형식).
- Returns:
bool, “finish_code”: str}. Ok 가 아니면 알림도 나간다.
- Return type:
{“finished”
- Raises:
ValueError – 빈 target, 모르는 컴포넌트, 길이 불일치, 유한수 아님, 허용 안 되는 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- static move_l(*, robot_model: str, target: dict[str, list[float]], reference: str = 'base', controllers: dict[str, str | dict[str, Any]] = {}, minimum_time: float = 3.0, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) dict[str, Any]#
Cartesian 이동 1회 — 손(ee_right/ee_left)·T5(link_torso_5) 자세로 이동하고 끝날 때까지 기다린다.
IK 는 로봇이 푼다. 나머지 규칙은 move_j 와 같다.
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”) → [x_mm, y_mm, z_mm, rx_deg, ry_deg, rz_deg] (R = Rz·Ry·Rx). torso 는 Base 기준, 손은 reference 기준.
reference – “base” 또는 “link_torso_5” (손 목표의 기준 — cartesians_from_position(reference) 와 같은 좌표).
controllers – 부위별 컨트롤러. 팔: “position”/”cartesian_impedance”/”impedance”. torso: “position”.
minimum_time – 최소 이동 시간 [s].
priority – 명령 우선순위.
flow_manager_args – move_j 와 같다.
- Returns:
bool, “finish_code”: str}.
- Return type:
{“finished”
- Raises:
ValueError – 빈 target, 모르는 컴포넌트·키, reference 오류, 유한수 아님, 허용 안 되는 컨트롤러.
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패·enable 실패·smooth jog 중.
- static open_serial_stream(*, robot_model: str, device_path: str, baudrate: int, bytesize: int = 8, parity: str = 'N', stopbits: int = 1, callback: Callable[[bytes], Any] | None = None) rb_sdk.rb_sdk_cpp.RBRby1SerialStream#
로봇의 시리얼 장치 스트림을 연다 (장치는 반환된 스트림의 connect() 로 연다).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
device_path – 장치 경로 (get_serial_device_list 의 path).
baudrate – 보드레이트.
bytesize – 데이터 비트 수.
parity – 패리티 (‘N’ / ‘E’ / ‘O’).
stopbits – 스톱 비트 수.
callback – callback(data: bytes) — 받은 데이터. 수신 전용 스레드에서 순서대로 불린다. None 이면 받지 않는다.
- Returns:
RBRby1SerialStream.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static power_off(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치 전원을 끈다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식 (예: “.*” 전체).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static power_on(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치 전원을 켠다. 켜진 장치는 건드리지 않고 꺼진 장치만 모아 한 번에 켠다 — 전부 켜져 있으면 아무것도 안 보내고 True.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식 (예: “.*” 전체, “^right_arm_.*”).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static reset_all_parameters(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) None#
모든 파라미터를 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static reset_battery_config(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
배터리 설정을 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static reset_fault_control_manager(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
control manager 의 fault 를 해제한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static reset_network_setting(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
네트워크 설정을 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static reset_odometry(*, robot_model: str, angle: float, position: numpy.ndarray[numpy.float64[2, 1]], flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
오도메트리를 주어진 값으로 초기화한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
angle – 새 각도 [rad].
position – 새 위치 [x, y] [m].
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static reset_parameter(*, robot_model: str, name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
파라미터 하나를 기본값으로 되돌린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static scan_wifi(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) list[rb_sdk.rb_sdk_cpp.rby1.WifiNetwork]#
주변 WiFi 네트워크를 검색한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
rby1.WifiNetwork 목록 (공식 타입).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static send_command(*, robot_model: str, builder: rb_sdk_cpp.rby1.RobotCommandBuilder, priority: int = 1) rb_sdk.rb_sdk_cpp.RBRby1CommandHandle#
로봇 명령을 보낸다 (수락까지만 — 완료는 핸들의 wait/get 으로 기다린다).
명령 완료가 PyFM step 완료이므로 flow_manager_args 는 핸들의 wait/get 에 넘긴다. 반환된 핸들을 버리면 명령이 취소된다 (공식 핸들 소멸자). await 가 실행 전에 취소되면 명령은 보내지 않는다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
builder – rby1.RobotCommandBuilder (공식 타입).
priority – 명령 우선순위 (높을수록 우선).
- Returns:
RBRby1CommandHandle.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static servo_off(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
관절 서보를 끈다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식 (예: “.*” 전체).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static servo_on(*, robot_model: str, dev_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
관절 서보를 켠다. 켜진 관절(is_ready)은 건드리지 않고 꺼진 관절만 모아 한 번에 켠다 — 전부 켜져 있으면 아무것도 안 보내고 True.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 관절 이름 정규식 (예: “.*” 전체, “^torso_.*”).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_battery_config(*, robot_model: str, cutoff_voltage: float, fully_charged_voltage: float, coefficients: Annotated[list[float], FixedSize(4)], flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
배터리 설정을 바꾼다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
cutoff_voltage – 차단 전압 [V].
fully_charged_voltage – 완충 전압 [V].
coefficients – 배터리 계수 4개.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_battery_level(*, robot_model: str, level: float, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
배터리 잔량을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
level – 배터리 잔량 [%] (0.0~100.0).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_led_color(*, robot_model: str, color: rb_sdk.rb_sdk_cpp.rby1.Color, duration: float = 1.0, transition_time: float = 0.0, blinking: bool = False, blinking_freq: float = 1.0, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
LED 색을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
color – rby1.Color (공식 타입, RGB 0~255).
duration – 유지 시간 [s].
transition_time – 전환 시간 [s].
blinking – 깜빡임 여부.
blinking_freq – 깜빡임 주파수 [Hz].
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_parameter(*, robot_model: str, name: str, value: str, write_db: bool = True, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
로봇 파라미터 값을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 파라미터 이름.
value – 파라미터 값 (문자열).
write_db – DB 에도 기록할지 여부.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 해당 파라미터가 없거나 호출 실패. RBY1ConnectionError 미연결.
- static set_position_d_gain(*, robot_model: str, dev_name: str, d_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치의 위치 제어 D 게인을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
d_gain – D 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_position_i_gain(*, robot_model: str, dev_name: str, i_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치의 위치 제어 I 게인을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
i_gain – I 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_position_p_gain(*, robot_model: str, dev_name: str, p_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치의 위치 제어 P 게인을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
p_gain – P 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_position_pid_gain(*, robot_model: str, dev_name: str, p_gain: int, i_gain: int, d_gain: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치의 위치 제어 P/I/D 게인을 한 번에 설정한다. PIDGain 객체로 주려면 set_position_pid_gain_object.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
p_gain – P 게인 (0~65535).
i_gain – I 게인 (0~65535).
d_gain – D 게인 (0~65535).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_position_pid_gain_object(*, robot_model: str, dev_name: str, pid_gain: rb_sdk.rb_sdk_cpp.rby1.PIDGain, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
장치의 위치 제어 PID 게인을 PIDGain 객체로 설정한다 (공식 SetPositionPIDGain 의 PIDGain 오버로드).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
dev_name – 장치 이름 정규식.
pid_gain – rby1.PIDGain (공식 타입).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_preset_position(*, robot_model: str, joint_name: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
관절의 preset 위치를 설정한다 (PVL 계열 모터만 지원).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
joint_name – 관절 이름.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_system_time(*, robot_model: str, utc_time: datetime.datetime, time_zone: str | None = None, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
로봇 시스템 시간을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
utc_time – 새 시간 (Python datetime.datetime; naive 면 로컬 시간으로 해석).
time_zone – 로봇 타임존 (예: “Asia/Seoul”). None 이면 타임존은 바꾸지 않는다.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_time_scale(*, robot_model: str, time_scale: float, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) float#
모션 실행 시간 배율을 설정한다. 0.0 은 정지, 1.0 은 최대 속도.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
time_scale – 설정할 time scale (0.0~1.0).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
로봇에 실제 적용된 time scale.
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- static set_tool_flange_digital_output(*, robot_model: str, name: str, channel: int, state: bool, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
툴 플랜지 디지털 출력 한 채널의 상태를 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 팔 이름 (“right” / “left”).
channel – 디지털 출력 채널 번호.
state – True = ON, False = OFF.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_tool_flange_digital_output_dual(*, robot_model: str, name: str, state_0: bool, state_1: bool, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
툴 플랜지 디지털 출력 채널 0/1 의 상태를 동시에 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 팔 이름 (“right” / “left”).
state_0 – 채널 0 상태 (True = ON).
state_1 – 채널 1 상태 (True = ON).
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static set_tool_flange_output_voltage(*, robot_model: str, name: str, voltage: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
툴 플랜지 출력 전압을 설정한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
name – 툴 플랜지 이름 (“right” / “left”).
voltage – 출력 전압 [V]. 보통 12 / 24, 0 이면 출력 끔.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇이 거부했거나 호출 실패. RBY1ConnectionError 미연결.
- static smoothjog_j(*, robot_model: str, target: dict[str, list[float]]) dict[str, list[float]]#
Smooth J heartbeat — 관절 목표를 따라 연속 이동한다. 세션·정지 규칙은 smoothjog_l 과 같다.
호출마다 JointPositionCommand 1개 (minimum_time 0.15s, 10°/s, 30°/s²). 1회 변화량은 관절별 0.5° 이하.
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”/”head”) → 관절값 [deg], 컴포넌트 전체 길이. 비어 있으면 안 된다.
- Returns:
받아들인 목표 (target 과 같음).
- Raises:
ValueError – 키·길이 오류, 유한수 아님, 빈 target.
RBY1ConnectionError – 미연결. RBY1Error 변화량 초과·로봇 busy·컨트롤러 거부·gRPC 실패.
- static smoothjog_l(*, robot_model: str, target: dict[str, list[float]], reference: str = 'base') dict[str, list[float]]#
Smooth L heartbeat — 손(및 T5) Cartesian 목표를 따라 연속 이동한다.
버튼을 누르는 동안 약 20Hz 로 부른다. 세션이 없으면 시작하고(스트림 1개, smooth_status “start”), 호출마다 CartesianCommand 1개를 보낸다 (minimum_time 0.15s, hold 0.5s). 250ms 동안 heartbeat 가 없으면 스스로 정지한다. target 의 키가 곧 명령에 넣는 부위. 1회 변화량은 위치 1.5mm·회전 0.35° 이하 (이전 목표 기준, 처음 오는 부위는 현재 FK 기준) — 넘으면 정지 + 예외. 세션 중 L/J·reference 변경도 정지 + 예외.
- Parameters:
robot_model – 연결된 model.
target – 컴포넌트(“torso”/”right_arm”/”left_arm”) → [x_mm, y_mm, z_mm, rx_deg, ry_deg, rz_deg]. 비어 있으면 안 된다.
reference – “base” 또는 “link_torso_5”.
- Returns:
받아들인 목표 (target 과 같음).
- Raises:
ValueError – reference·키·길이 오류, 유한수 아님, 빈 target.
RBY1ConnectionError – 미연결. RBY1Error 변화량 초과·로봇 busy·컨트롤러 거부·gRPC 실패.
- static smoothjog_stop(*, robot_model: str, reason: str = 'user') bool#
Smooth jog 정지 (L/J 공용). 스트림 취소 → cancel_control → Idle 대기(최대 1.5s) → smooth_status “stop”.
- Parameters:
robot_model – 연결된 model.
reason – 로그용 정지 사유.
- Returns:
정지한 세션이 있었으면 True.
- static start_log_stream(*, robot_model: str, callback: Callable[[list], Any], rate: float) None#
로봇 로그 스트림을 시작한다 (유실 최소화 대기열).
콜백은 스트림 전용 스레드에서 받은 순서대로 한 번에 하나씩 불린다. 콜백이 느려도 gRPC 수신은 막히지 않고 1024 batch 까지 쌓이며, 넘치면 가장 오래된 것부터 버린다 (log_stream_stats 의 dropped). 콜백이 awaitable(코루틴 등)을 돌려주면 등록 시점의 실행 중 이벤트 루프에서 실행하고 끝날 때까지 다음 batch 를 넘기지 않는다. 코루틴 함수를 이벤트 루프 밖에서 등록하면 RuntimeError. 콜백 예외는 stderr 로 출력하고 스트림은 계속된다. 같은 model 로 다시 부르면 이전 스트림을 멈추고 새로 시작한다. disconnect_robot 은 스트림을 멈춘다. 콜백 안에서 stop_log_stream 을 불러도 된다. 끊김 복구는 start_state_update 와 같다 (max(10/rate, 1)초 동안 수신이 없으면 다시 구독, log_stream_stats 의 resubscribes).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
callback – callback(logs) — logs 는 rby1.Log 목록 (공식 스트림 콜백 1회분).
rate – 요청 수신 주기(Hz).
- Raises:
RBY1Error – model 불일치. RBY1ConnectionError 미연결.
- static start_state_update(*, robot_model: str, callback: Callable[..., Any], rate: float) None#
로봇 상태 스트림을 시작한다 (latest-only).
공식 start_state_update 와 같이 콜백 인자는 1개 또는 2개다: callback(state) 또는 callback(state, control_manager_state). 개수는 등록 때 한 번 inspect.signature(callback).parameters 로 센다 (bound method 의 self, partial 로 묶인 인자는 빠진다). 그 밖의 개수면 TypeError. 두 값은 같은 스트림 샘플 (GetRobotStateStream 응답 하나)에서 온다 — 1개 형도 같은 RPC 이므로 비용 차이는 없다.
콜백은 스트림 전용 스레드에서 한 번에 하나씩 불린다. 콜백이 느리면 그 사이 도착한 상태는 최신 것만 남고 나머지는 버린다 (gRPC 수신은 막히지 않는다). 콜백이 awaitable(코루틴 등)을 돌려주면 등록 시점의 실행 중 이벤트 루프에서 실행하고 끝날 때까지 다음 상태를 넘기지 않는다 (코루틴도 latest-only). 코루틴 함수를 이벤트 루프 밖에서 등록하면 RuntimeError, 그 밖의 콜백이 루프 없이 awaitable 을 돌려주면 에러 로그 후 그 상태를 버린다. 콜백 예외는 stderr 로 출력하고 스트림은 계속된다. 같은 model 로 다시 부르면 이전 스트림을 멈추고 새로 시작한다. 콜백 안에서 stop_state_update 를 불러도 된다.
끊김 복구: 공식 SDK 는 서버가 스트림을 끝내도 알리지 않으므로, max(10/rate, 1)초 동안 상태가 안 오면 다시 구독한다 (stderr 에 끊김·복구 한 줄씩, 재시도 간격은 두 배씩 4배까지, state_update_stats 의 resubscribes). gRPC 연결은 공식 채널이 스스로 다시 맺으므로 로봇이 돌아오면 connect_robot 없이 스트림이 이어진다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
callback – callback(state) 또는 callback(state, control_manager_state) — state 는 rby1.RobotState_A / _M / _UB, control_manager_state 는 rby1.ControlManagerState (공식 타입).
rate – 요청 수신 주기(Hz).
- Raises:
RBY1Error – model 불일치. RBY1ConnectionError 미연결. TypeError 콜백 인자 개수가 1·2 가 아님.
- static stop(*, robot_model: str, priority: int = 1, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) dict[str, Any]#
모션 정지 — StopCommand(whole body) 를 보내고 끝날 때까지 기다린다.
finish_code 가 Ok 가 아니면 예외 대신 그대로 반환하고, muscat/{robot_model}/message 로 ERROR 알림 (
RBY1 Move Error: <code>, 사유는 로봇 마지막 로그)을 보낸다. 정지 명령이라 await 가 취소돼도 명령은 취소하지 않는다 (끝날 때까지 기다리고 done() 만 막는다).- Parameters:
robot_model – 연결된 model (“a” / “m” / “ub”).
priority – 명령 우선순위. 진행 중인 명령보다 확실히 우선하려면 높게.
flow_manager_args – Optional PyFM step context. 명령이 끝나면 done() 을 호출한다.
- Returns:
bool, “finish_code”: str}.
- Return type:
{“finished”
- Raises:
RBY1ConnectionError – 미연결. RBY1Error model 불일치·gRPC 실패.
- static stop_log_stream(*, robot_model: str) bool#
로그 스트림을 멈춘다. 진행 중인 동기 콜백이 끝날 때까지 기다리고 (콜백 안에서 부르면 기다리지 않는다), 진행 중인 코루틴 콜백은 취소한다. 아직 콜백에 넘기지 못한 로그는 버린다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”).
- Returns:
동작 중이던 스트림이 있었으면 True.
- static stop_state_update(*, robot_model: str) bool#
상태 스트림을 멈춘다. 진행 중인 동기 콜백이 끝날 때까지 기다리고 (콜백 안에서 부르면 기다리지 않는다), 진행 중인 코루틴 콜백은 취소한다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”).
- Returns:
동작 중이던 스트림이 있었으면 True.
- static sync_time(*, robot_model: str, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
로봇과 시간 동기화를 한 번 한다 (Ping 왕복으로 로봇 시계 오프셋 추정 — 이후 RobotState/Log 의 timestamp 가 로컬 시계 기준으로 보정된다).
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
성공하면 True.
- Raises:
RBY1Error – 로봇 응답에 시각이 없음 또는 호출 실패. RBY1ConnectionError 미연결.
- static wait_for_control_ready(*, robot_model: str, timeout_ms: int, flow_manager_args: rb_schemas.sdk.FlowManagerArgs | None = None) bool#
로봇이 제어 명령을 받을 준비가 될 때까지 기다린다. servo_on 뒤, 명령 전에 부른다.
- Parameters:
robot_model – 로봇 model (“a” / “m” / “ub”). 연결된 로봇과 다르면 실패.
timeout_ms – 타임아웃 [ms].
flow_manager_args – Optional PyFM step context. 성공하면 done() 을 호출한다.
- Returns:
준비됐으면 True, 타임아웃이면 False (예외 아님).
- Raises:
RBY1Error – 호출 실패. RBY1ConnectionError 미연결.
- class rb_sdk.rb_sdk_cpp.RBY1Error#
Bases:
RuntimeError
RBY1-SDK Python bindings.
This module provides high-level APIs for RB-Y1 communication, control, modeling, etc. It includes mathematical operations, dynamics calculations, robot control, and various utility functions for working with RB-Y1 robots.
Submodules#
math : Mathematical operations and Lie group utilities dynamics : Robot dynamics calculations upc : Utilities for controlling and communicating with devices on the user PC
- class rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder#
Arm command builder.
Wraps a command for an arm component. This builder accepts multiple command types, such as joint position, gravity compensation, Cartesian impedance, or joint impedance commands, and provides a unified interface to send them to an arm.
Notes
In practice, you often do not need to explicitly construct an ArmCommandBuilder. Functions like
set_right_arm_command(...)orset_left_arm_command(...)automatically cast and wrap a command (e.g., JointPositionCommandBuilder) into an ArmCommandBuilder. For example:>>> body.set_right_arm_command(rby.JointPositionCommandBuilder().set_position(...))
is equivalent to:
>>> body.set_right_arm_command(rby.ArmCommandBuilder( ... rby.JointPositionCommandBuilder().set_position(...)))
Therefore, explicitly constructing ArmCommandBuilder is usually unnecessary unless you want to be explicit; repeatedly wrapping it is inefficient.
Examples
>>> import numpy as np, rby1_sdk as rby >>> # Send a joint position command to the right arm >>> jp = ( ... rby.JointPositionCommandBuilder() ... .set_position(np.zeros(7)) ... .set_minimum_time(2.0) ... ) >>> body = rby.BodyComponentBasedCommandBuilder() >>> # Implicit wrapping into ArmCommandBuilder >>> body.set_right_arm_command(jp) >>> cmd = rby.RobotCommandBuilder().set_command(body) >>> # robot.send_command(cmd, priority=1).get()
- set_command(*args, **kwargs)#
Overloaded function.
set_command(self: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder, joint_position_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder
Set a joint position command for the arm.
- Parameters:
joint_position_command_builder (JointPositionCommandBuilder) – Joint position command to wrap.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder, gravity_compensation_command_builder: rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder
Set a gravity compensation command for the arm.
- Parameters:
gravity_compensation_command_builder (GravityCompensationCommandBuilder) – Gravity compensation command to wrap.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder, cartesian_command_builder: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder
Set a Cartesian command for the arm.
- Parameters:
cartesian_command_builder (CartesianCommandBuilder) – Cartesian command to wrap.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder, impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder
Set an impedance control command for the arm.
- Parameters:
impedance_control_command_builder (ImpedanceControlCommandBuilder) – Cartesian impedance control command to wrap.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder, joint_impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder
Set a joint impedance control command for the arm.
- Parameters:
joint_impedance_control_command_builder (JointImpedanceControlCommandBuilder) – Joint impedance control command to wrap.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder, cartesian_impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder
Set a Cartesian impedance control command for the arm.
- Parameters:
cartesian_impedance_control_command_builder (CartesianImpedanceControlCommandBuilder) – Cartesian impedance control command to wrap.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.ArmCommandFeedback#
Feedback for an arm command container.
- Variables:
joint_position_command (JointPositionCommandFeedback) – Feedback for a joint position command (if present).
gravity_compensation_command (GravityCompensationCommandFeedback) – Feedback for a gravity compensation command (if present).
cartesian_command (CartesianCommandFeedback) – Feedback for a Cartesian command (if present).
impedance_control_command (ImpedanceControlCommandFeedback) – Feedback for a Cartesian impedance command (if present).
cartesian_impedance_control_command (CartesianImpedanceControlCommandFeedback) – Feedback for a Cartesian impedance (OC + joint-space impedance) command (if present).
joint_impedance_control_command (JointImpedanceControlCommandFeedback) – Feedback for a joint-space impedance command (if present).
- property cartesian_command#
Cartesian command feedback.
- Returns:
Feedback object.
- Return type:
- property cartesian_impedance_control_command#
Cartesian impedance (OC + joint-space impedance) command feedback.
- Returns:
Feedback object.
- Return type:
- property gravity_compensation_command#
Gravity compensation command feedback.
- Returns:
Feedback object.
- Return type:
- property impedance_control_command#
Cartesian impedance command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_impedance_control_command#
Joint-space impedance command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_position_command#
Joint position command feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.BatteryInfo#
Battery information.
This class represents battery information for the robot. Currently contains no specific attributes.
- class rb_sdk.rb_sdk_cpp.rby1.BatteryState#
Battery state information.
Provides information about battery status including voltage, current, and charge level.
- Variables:
voltage (float) – Battery voltage in V.
current (float) – Battery current [A].
level_percent (float) – Battery charge level percentage (0.0 to 100.0).
- property current#
- property level_percent#
- property voltage#
- class rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder#
Body command builder.
Wraps commands for the robot’s body subsystem (torso + both arms). It can hold a variety of command types including joint position, optimal control, gravity compensation, Cartesian motion, and impedance control.
Notes
Typically used with
set_body_command(...)of a ComponentBasedCommandBuilder.You do not need to explicitly wrap commands in BodyCommandBuilder; passing a supported builder (e.g., JointPositionCommandBuilder) into
set_body_commandwill automatically cast it to BodyCommandBuilder.
Examples
>>> import numpy as np, rby1_sdk as rby >>> # Example 1: Joint position body command >>> jp = rby.JointPositionCommandBuilder().set_position(np.zeros(20)) # full body, N=20 >>> body = rby.BodyCommandBuilder().set_command(jp) >>> comp = rby.ComponentBasedCommandBuilder().set_body_command(body) >>> rc = rby.RobotCommandBuilder().set_command(comp) >>> # robot.send_command(rc, priority=1).get() >>> >>> # Example 2: Gravity compensation >>> gc = rby.GravityCompensationCommandBuilder().set_on(True) >>> comp = rby.ComponentBasedCommandBuilder().set_body_command(gc) # implicit wrap >>> rc = rby.RobotCommandBuilder().set_command(comp)
- set_command(*args, **kwargs)#
Overloaded function.
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, joint_position_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign a joint position command.
- Parameters:
joint_position_command_builder (JointPositionCommandBuilder) – Joint-space position command (vector length N = body DOF).
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, optimal_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign an optimal control command.
- Parameters:
optimal_control_command_builder (OptimalControlCommandBuilder) – Optimal control objective.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, gravity_compensation_command_builder: rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign a gravity compensation command.
- Parameters:
gravity_compensation_command_builder (GravityCompensationCommandBuilder) – Command enabling or disabling gravity compensation.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, cartesian_command_builder: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign a Cartesian command.
- Parameters:
cartesian_command_builder (CartesianCommandBuilder) – Cartesian trajectory command.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, body_component_based_command_builder: rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign a body component–based command (arms, torso).
- Parameters:
body_component_based_command_builder (BodyComponentBasedCommandBuilder) – Command composed of right arm, left arm, and torso subcommands.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, joint_impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign a joint impedance control command.
- Parameters:
joint_impedance_control_command_builder (JointImpedanceControlCommandBuilder) – Joint-space impedance control command.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder, cartesian_impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder
Assign a Cartesian impedance control command.
- Parameters:
cartesian_impedance_control_command_builder (CartesianImpedanceControlCommandBuilder) – Cartesian impedance control command.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.BodyCommandFeedback#
Feedback for a body command container.
- Variables:
joint_position_command (JointPositionCommandFeedback) – Feedback for a joint position command (if present).
optimal_control_command (OptimalControlCommandFeedback) – Feedback for an optimal-control command (if present).
gravity_compensation_command (GravityCompensationCommandFeedback) – Feedback for a gravity compensation command (if present).
cartesian_command (CartesianCommandFeedback) – Feedback for a Cartesian command (if present).
body_component_based_command (BodyComponentBasedCommandFeedback) – Feedback for a component-based body command (if present).
cartesian_impedance_control_command (CartesianImpedanceControlCommandFeedback) – Feedback for a Cartesian impedance (OC + joint-space impedance) command (if present).
joint_impedance_control_command (JointImpedanceControlCommandFeedback) – Feedback for a joint-space impedance command (if present).
- property body_component_based_command#
Component-based body command feedback.
- Returns:
Feedback object.
- Return type:
- property cartesian_command#
Cartesian command feedback.
- Returns:
Feedback object.
- Return type:
- property cartesian_impedance_control_command#
Cartesian impedance (OC + joint-space impedance) command feedback.
- Returns:
Feedback object.
- Return type:
- property gravity_compensation_command#
Gravity compensation command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_impedance_control_command#
Joint-space impedance command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_position_command#
Joint position command feedback.
- Returns:
Feedback object.
- Return type:
- property optimal_control_command#
Optimal-control command feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder#
Body component-based command builder.
Provides methods to assign commands to specific body parts: right arm, left arm, and torso. Each setter accepts either the corresponding CommandBuilder wrapper (e.g., ArmCommandBuilder, TorsoCommandBuilder) or a lower-level builder like JointPositionCommandBuilder, which will be automatically cast.
Notes
For convenience, you can directly pass a JointPositionCommandBuilder (or other valid builders) without explicitly wrapping it in an ArmCommandBuilder or TorsoCommandBuilder. The system will automatically perform the conversion.
This avoids redundant wrapping and makes usage more concise.
Examples
>>> import numpy as np, rby1_sdk as rby >>> body = rby.BodyComponentBasedCommandBuilder() >>> # Implicitly wraps into ArmCommandBuilder >>> body.set_right_arm_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(7)) ... ) >>> # Implicitly wraps into TorsoCommandBuilder >>> body.set_torso_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(6)) ... ) >>> cmd = rby.RobotCommandBuilder().set_command(body) >>> # robot.send_command(cmd, priority=1).get()
- set_left_arm_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder, arm_command_builder: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder#
Assign a command to the left arm.
- Parameters:
arm_command_builder (ArmCommandBuilder or compatible builder) – Command for the left arm. If a lower-level builder is provided (e.g., JointPositionCommandBuilder), it will be automatically wrapped into an ArmCommandBuilder.
- Returns:
Self reference for method chaining.
- Return type:
- set_right_arm_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder, arm_command_builder: rb_sdk.rb_sdk_cpp.rby1.ArmCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder#
Assign a command to the right arm.
- Parameters:
arm_command_builder (ArmCommandBuilder or compatible builder) – Command for the right arm. If a lower-level builder is provided (e.g., JointPositionCommandBuilder), it will be automatically wrapped into an ArmCommandBuilder.
- Returns:
Self reference for method chaining.
- Return type:
- set_torso_command(self: rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder, torso_command_builder: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandBuilder#
Assign a command to the torso.
- Parameters:
torso_command_builder (TorsoCommandBuilder or compatible builder) – Command for the torso. If a lower-level builder is provided (e.g., JointPositionCommandBuilder, OptimalControlCommandBuilder), it will be automatically wrapped into a TorsoCommandBuilder.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.BodyComponentBasedCommandFeedback#
Feedback for a body command composed of named components.
- Variables:
right_arm_command (ArmCommandFeedback) – Feedback for the right arm component.
left_arm_command (ArmCommandFeedback) – Feedback for the left arm component.
torso_command (TorsoCommandFeedback) – Feedback for the torso component.
- property left_arm_command#
Left-arm component feedback.
- Returns:
Feedback object.
- Return type:
- property right_arm_command#
Right-arm component feedback.
- Returns:
Feedback object.
- Return type:
- property torso_command#
Torso component feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Cartesian command builder.
Builds end-effector Cartesian pose targets and optional per-joint auxiliary targets. Each Cartesian target specifies a desired homogeneous transform \({}^{ref}\!T^{link}_d \in SE(3)\) together with velocity/acceleration constraints used to time the motion.
Notes
Cartesian error is computed in the reference frame and tracked subject to velocity/acceleration limits provided per target.
Joint targets added via
add_joint_position_targetare auxiliary hints that can help disambiguate IK or bias the posture during Cartesian tracking.
Examples
>>> import numpy as np, rby1_sdk as rby >>> T = np.eye(4); T[0,3] = 0.40; T[2,3] = 0.60 # 40 cm forward, 60 cm up >>> cart = ( ... rby.CartesianCommandBuilder() ... .add_target("base", "link_torso_5", T, ... linear_velocity_limit=0.4, # [m/s] ... angular_velocity_limit=1.0, # [rad/s] ... acceleration_limit_scaling=0.6) ... .add_joint_position_target("right_arm_3", 0.3, velocity_limit=1.2) ... .set_minimum_time(2.0) ... )
- add_joint_position_target(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, joint_name: str, target_position: float, velocity_limit: float | None = None, acceleration_limit: float | None = None) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Add an auxiliary joint position target.
- Parameters:
joint_name (str) – Joint name to bias.
target_position (float) – Desired joint position [rad].
velocity_limit (Optional[float], default=None) – Per-joint velocity limit [rad/s] for this target (if provided).
acceleration_limit (Optional[float], default=None) – Per-joint acceleration limit [rad/s²] for this target (if provided).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Useful to resolve redundancy or bias posture while tracking Cartesian goals.
If limits are omitted, internal defaults/URDF-derived limits are used.
- add_target(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, ref_link_name: str, link_name: str, T: numpy.ndarray[numpy.float64[4, 4]], linear_velocity_limit: float, angular_velocity_limit: float, acceleration_limit_scaling: float) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Add a Cartesian pose target for a link.
- Parameters:
ref_link_name (str) – Reference frame (link) in which the target pose is expressed.
link_name (str) – Controlled link name (end-effector).
T (numpy.ndarray, shape (4,4), dtype=float64) – Desired homogeneous transform \({}^{ref}\!T^{link}_d \in SE(3)\).
linear_velocity_limit (float) – Maximum allowed translational speed [m/s].
angular_velocity_limit (float) – Maximum allowed rotational speed [rad/s].
acceleration_limit_scaling (float) – Dimensionless scaling applied to internal Cartesian acceleration limits (e.g.,
0.5halves the default internal limits).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Limits here shape trajectory timing; they do not redefine hardware limits.
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Set the minimum execution time for the motion.
- Parameters:
minimum_time (float) –
The shortest allowed duration (in seconds) to reach the target.
If the motion profile based on velocity/acceleration limits would finish earlier, the motion is slowed down to take exactly minimum_time.
If the natural motion takes longer than minimum_time, this parameter is ignored.
This parameter provides an additional degree of freedom to control arrival time. Instead of relying solely on velocity and acceleration limits, you can set high limits and then enforce the desired duration using minimum_time.
For streaming commands, this prevents the robot from arriving too early and waiting idly, thereby ensuring smooth and continuous motion.
- Returns:
Self reference for method chaining.
- Return type:
- set_stop_joint_position_tracking_error(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, stop_joint_position_tracking_error: float) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Set the stop threshold on joint-space position tracking error.
- Parameters:
stop_joint_position_tracking_error (float) – Threshold on per-joint position error [rad]. When joint errors fall below this value (and other conditions are met), the controller may stop.
- Returns:
Self reference for method chaining.
- Return type:
- set_stop_orientation_tracking_error(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, stop_orientation_tracking_error: float) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Set the stop threshold on rotational tracking error.
- Parameters:
stop_orientation_tracking_error (float) – Threshold on orientation error [rad]. When the orientation error falls below this value, the controller may stop.
- Returns:
Self reference for method chaining.
- Return type:
- set_stop_position_tracking_error(self: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder, stop_position_tracking_error: float) rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder#
Set the stop threshold on translational tracking error.
- Parameters:
stop_position_tracking_error (float) – Threshold on \(\|\Delta x\|\) [m]. When the position error falls below this value (and other conditions are met), the controller may stop.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.CartesianCommandFeedback#
Feedback for a Cartesian command with one or more SE(3) pose targets.
- Variables:
se3_pose_tracking_errors (list[CartesianCommandFeedback.TrackingError]) – Per-target pose tracking errors (position/orientation).
joint_position_tracking_errors (list[float]) – Per-joint position tracking errors [rad].
remain_time (float) – Estimated remaining time to reach targets [s].
manipulability (float) – Manipulability index (dimensionless).
- class TrackingError#
Per-target SE(3) tracking error.
- Variables:
position_error (float) – Translational error magnitude [m].
orientation_error (float) – Rotational error magnitude [rad] (e.g., angle-axis norm).
- property orientation_error#
- property position_error#
- property joint_position_tracking_errors#
Per-joint position tracking errors.
- Returns:
Joint-wise position error magnitudes [rad].
- Return type:
list[float]
- property manipulability#
Manipulability index.
- Returns:
Dimensionless manipulability measure (higher is generally better).
- Return type:
float
- property remain_time#
Estimated remaining time to reach targets.
- Returns:
Time remaining [s].
- Return type:
float
- property se3_pose_tracking_errors#
Per-target SE(3) pose tracking errors.
- Returns:
Tracking error objects for each Cartesian target.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Cartesian impedance control command builder.
Takes Cartesian pose targets (in SE(3)) but executes control in joint space: first, an optimal control / inverse-kinematics problem finds joint targets \(q^\*\) that best realize the Cartesian objectives; then a joint-space impedance controller tracks \(q^\*\) using the stiffness/damping/torque limits you set.
Pipeline#
Cartesian objective (se(3) error): for each target transform \({}^{ref}\!T^{link}_d\), an error \(\xi = [\,\Delta x;\,\Delta\phi\,] \in \mathbb{R}^6\) is formed (translation/orientation in se(3)) and contributes to an optimal-control cost.
Optimal control solve: solves for joint configuration \(q^\*\) (and, if needed, velocities/accelerations) that minimize a weighted sum of Cartesian errors and optional joint terms while respecting internal (scaled) velocity/acceleration limits and joint bounds.
Joint-space impedance tracking: applies
\[\tau \;=\; K \,(q^\* - q) \;+\; D \,(\dot{q}^\* - \dot{q}) \;+\; \tau_{ff},\]where \(K=\mathrm{diag}(k_1,\ldots,k_N)\) is set via
set_joint_stiffness(...)(diagonal terms only), \(D\) is built from a damping ratio \(\zeta\) as\[D \;=\; \zeta \left(\sqrt{M}\sqrt{K} \;+\; \sqrt{K}\sqrt{M}\right),\]with \(M\) the joint-space inertia, and \(\tau_{ff}\) is the gravity feed-forward torque. The final torque is saturated per-joint by
set_joint_torque_limit(...):\[\tau_{\text{applied}} \;=\; \mathrm{clip}(\tau,\,-\tau_{\max},\,\tau_{\max}).\]
What each setting affects#
add_target(...): defines Cartesian pose costs used only in the optimal-control solve that produces \(q^\*\).set_joint_stiffness(...),set_joint_damping_ratio(...),set_joint_torque_limit(...): shape the joint-space impedance that tracks \(q^\*\) (they do not change the Cartesian cost; they change how \(q^\*\) is followed).add_joint_position_target(...)andadd_joint_limit(...): add joint-space costs/constraints to the optimal-control stage.Velocity/acceleration limits passed to
add_target(...)are used as internal bounds/scalings for the solver, not hardware limits.
Examples
>>> import numpy as np, rby1_sdk as rby >>> T = np.eye(4); T[0,3] = 0.45; T[2,3] = 0.60 # desired wrist pose in base_link >>> cmd = ( ... rby.CartesianImpedanceControlCommandBuilder() ... .add_target("base_link", "right_wrist", T, ... linear_velocity_limit=0.3, # solver internal bounds ... angular_velocity_limit=0.8) ... .add_joint_position_target("right_arm_3", 0.5) # joint hint in the OC stage ... .set_joint_stiffness(np.full(7, 40.0)) # K diag for joint impedance ... .set_joint_damping_ratio(0.7) # ζ → D ... .set_joint_torque_limit(np.full(7, 35.0)) # τ saturation ... .set_minimum_time(2.0) ... )
- add_joint_limit(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, joint_name: str, lower: float, upper: float) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Add a joint position limit.
- Parameters:
joint_name (str) – Joint name.
lower (float) – Lower limit [rad].
upper (float) – Upper limit [rad].
- Returns:
Self reference for method chaining.
- Return type:
- add_joint_position_target(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, joint_name: str, target_position: float, velocity_limit: float | None = None, acceleration_limit: float | None = None) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Add an auxiliary joint position target.
- Parameters:
joint_name (str) – Joint name.
target_position (float) – Desired position [rad].
velocity_limit (Optional[float]) – Max velocity [rad/s].
acceleration_limit (Optional[float]) – Max acceleration [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
- add_target(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, ref_link_name: str, link_name: str, T: numpy.ndarray[numpy.float64[4, 4]], linear_velocity_limit: float | None = None, angular_velocity_limit: float | None = None, linear_acceleration_limit: float | None = None, angular_acceleration_limit: float | None = None) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Add a Cartesian impedance target.
- Parameters:
ref_link_name (str) – Reference frame (link) name.
link_name (str) – Controlled link name (end-effector).
T (numpy.ndarray, shape (4,4), dtype=float64) – Desired homogeneous transform \({}^{ref}\!T^{link}_d\).
linear_velocity_limit (Optional[float]) – Max translational velocity [m/s].
angular_velocity_limit (Optional[float]) – Max angular velocity [rad/s].
linear_acceleration_limit (Optional[float]) – Max translational acceleration [m/s²].
angular_acceleration_limit (Optional[float]) – Max angular acceleration [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_joint_damping_ratio(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, damping_ratio: float) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set joint damping ratio.
- Parameters:
damping_ratio (float) – Dimensionless damping ratio ζ.
- Returns:
Self reference for method chaining.
- Return type:
- set_joint_stiffness(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, stiffness: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set per-joint stiffness.
- Parameters:
stiffness (numpy.ndarray, shape (N,), dtype=float64) – Joint stiffness values (Nm/rad).
- Returns:
Self reference for method chaining.
- Return type:
- set_joint_torque_limit(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, torque_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set per-joint torque limits.
- Parameters:
torque_limit (numpy.ndarray, shape (N,), dtype=float64) – Max torques [Nm].
- Returns:
Self reference for method chaining.
- Return type:
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set minimum execution time.
- Parameters:
minimum_time (float) – Minimum time [s] to execute trajectory.
- Returns:
Self reference for method chaining.
- Return type:
- set_nullspace_joint_target(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, target_position: numpy.ndarray[numpy.float64[m, 1]], weight: numpy.ndarray[numpy.float64[m, 1]], k_p: float | None = 0.2, k_d: float | None = 0.2, cost_weight: float | None = 0.001) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set nullspace joint target.
- Parameters:
target_position (numpy.ndarray, shape (N,), dtype=float64) – Desired position [rad].
weight (numpy.ndarray, shape (N,), dtype=float64) – Weight for the nullspace term.
k_p (float, optional, default=0.2) – Proportional gain for the nullspace term.
k_d (float, optional, default=0.2) – Derivative gain for the nullspace term.
cost_weight (float, optional, default=1e-3) – Cost weight for the nullspace term.
- Returns:
Self reference for method chaining.
- Return type:
- set_reset_reference(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, reset_reference: bool) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set whether to reset the reference pose.
- Parameters:
reset_reference (bool) – If True, resets the reference configuration before applying new targets.
- Returns:
Self reference for method chaining.
- Return type:
- set_stop_joint_position_tracking_error(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, stop_joint_position_tracking_error: float) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set stop threshold on joint position error.
- Parameters:
stop_joint_position_tracking_error (float) – Threshold [rad].
- Returns:
Self reference for method chaining.
- Return type:
- set_stop_orientation_tracking_error(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, stop_orientation_tracking_error: float) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set stop threshold on orientation error.
- Parameters:
stop_orientation_tracking_error (float) – Threshold [rad].
- Returns:
Self reference for method chaining.
- Return type:
- set_stop_position_tracking_error(self: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder, stop_position_tracking_error: float) rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder#
Set stop threshold on translational error.
- Parameters:
stop_position_tracking_error (float) – Threshold [m].
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandFeedback#
Feedback for a Cartesian-impedance control command.
- Variables:
set_position (numpy.ndarray, shape (N,), dtype=float64) – Current joint setpoint used by the internal joint-space controller [rad].
remain_time (float) – Estimated remaining time to settle [s].
manipulability (float) – Manipulability index (dimensionless).
- property manipulability#
Manipulability index.
- Returns:
Dimensionless manipulability measure.
- Return type:
float
- property remain_time#
Estimated remaining time to settle.
- Returns:
Time remaining [s].
- Return type:
float
- property set_position#
Current joint setpoint used by the internal joint-space controller.
- Returns:
Joint setpoint vector [rad], shape (N,).
- Return type:
numpy.ndarray
- class rb_sdk.rb_sdk_cpp.rby1.Color#
RGB color representation.
Represents a color using red, green, and blue components.
- Variables:
r (int) – Red component [0, 255].
g (int) – Green component [0, 255].
b (int) – Blue component [0, 255].
- property b#
- property g#
- property r#
- class rb_sdk.rb_sdk_cpp.rby1.CommandFeedback#
Base type of feedback for specific command categories.
- Variables:
command_header (CommandHeaderFeedback) – Header-level feedback shared by all command types.
- property command_header#
Header-level feedback.
- Returns:
Header feedback (e.g., finished flag).
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder#
Command header builder.
Builds command headers with control hold time settings.
Examples
>>> import numpy as np, rby1_sdk as rby >>> header = rby.CommandHeaderBuilder().set_control_hold_time(5.0) >>> # Use this header in any command builder: >>> jp = rby.JointPositionCommandBuilder().set_command_header(header) >>> # Control hold time keeps the command active for 5 seconds
- set_control_hold_time(self: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder, control_hold_time: float) rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder#
Set the control hold time.
- Parameters:
control_hold_time (float) – Control hold time in seconds.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.CommandHeaderFeedback#
Header-level feedback common to all commands.
- Variables:
finished (bool) – Whether the command has finished (as assessed by the controller).
- property finished#
Whether the command has finished.
- Returns:
Trueif the command is finished; otherwiseFalse.- Return type:
bool
- class rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder#
Component-based command builder.
Provides a unified builder interface to compose commands for the robot’s main subsystems: mobility, body, and head. Each setter accepts either the corresponding CommandBuilder wrapper (e.g., MobilityCommandBuilder, BodyCommandBuilder, HeadCommandBuilder) or lower-level builders (e.g., JointVelocityCommandBuilder, JointPositionCommandBuilder), which are automatically cast into the appropriate wrapper.
Notes
This is typically used inside a RobotCommandBuilder to assemble subsystem-level commands into a single robot command.
Automatic casting removes the need to explicitly wrap builders, simplifying code.
Examples
>>> import numpy as np, rby1_sdk as rby >>> comp = rby.ComponentBasedCommandBuilder() >>> # Mobility: send SE2 velocity >>> comp.set_mobility_command( ... rby.SE2VelocityCommandBuilder().set_velocity(np.array([0.1, 0.0]), 0.2) ... ) >>> # Body: send a joint position command to the right arm >>> comp.set_body_command( ... rby.BodyComponentBasedCommandBuilder().set_right_arm_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(7)) ... ) ... ) >>> # Head: send a joint position command to head joints >>> comp.set_head_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(2)) ... ) >>> cmd = rby.RobotCommandBuilder().set_command(comp) >>> # robot.send_command(cmd, priority=1).get()
- set_body_command(self: rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder, body_command_builder: rb_sdk.rb_sdk_cpp.rby1.BodyCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder#
Assign a body command.
- Parameters:
body_command_builder (BodyCommandBuilder or compatible builder) – Command for the body subsystem. If a lower-level builder is provided (e.g., BodyComponentBasedCommandBuilder, JointPositionCommandBuilder), it will be automatically wrapped into a BodyCommandBuilder.
- Returns:
Self reference for method chaining.
- Return type:
- set_head_command(self: rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder, head_command_builder: rb_sdk.rb_sdk_cpp.rby1.HeadCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder#
Assign a head command.
- Parameters:
head_command_builder (HeadCommandBuilder or compatible builder) – Command for the head subsystem. If a lower-level builder is provided (e.g., JointPositionCommandBuilder), it will be automatically wrapped into a HeadCommandBuilder.
- Returns:
Self reference for method chaining.
- Return type:
- set_mobility_command(self: rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder, mobility_command_builder: rb_sdk.rb_sdk_cpp.rby1.MobilityCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder#
Assign a mobility command.
- Parameters:
mobility_command_builder (MobilityCommandBuilder or compatible builder) – Command for the mobility subsystem. If a lower-level builder is provided (e.g., SE2VelocityCommandBuilder, JointVelocityCommandBuilder), it will be automatically wrapped into a MobilityCommandBuilder.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandFeedback#
Feedback for a component-based command container.
- Variables:
head_command (HeadCommandFeedback) – Feedback for the head component (if present).
body_command (BodyCommandFeedback) – Feedback for the body component (if present).
mobility_command (MobilityCommandFeedback) – Feedback for the mobility component (if present).
- property body_command#
Body component feedback.
- Returns:
Feedback object.
- Return type:
- property head_command#
Head component feedback.
- Returns:
Feedback object.
- Return type:
- property mobility_command#
Mobility component feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.ControlManagerState#
Control manager state information.
This class represents the current state of the robot’s control manager, including operational status, time scaling, and joint enablement.
- Variables:
state (State) – Current operational state of the control manager.
time_scale (float) – Time scaling factor from 0.0 (stopped) to 1.0 (normal speed).
control_state (ControlState) – Current control execution state.
enabled_joint_idx (list[int]) – Indices of currently enabled joints.
unlimited_mode_enabled (bool) – Whether unlimited mode is currently enabled.
- class ControlState#
Control execution state enumeration.
Defines the current state of control execution within the control manager.
Members#
- Unknownint
Control state is unknown or undefined.
- Idleint
No control commands are being executed.
- Executingint
Control commands are actively being executed.
- Switchingint
Control is switching between different modes or commands.
Members:
Unknown
Idle
Executing
Switching
- Executing = <ControlState.Executing: 2>#
- Idle = <ControlState.Idle: 1>#
- Switching = <ControlState.Switching: 3>#
- Unknown = <ControlState.Unknown: 0>#
- ControlManagerState.ControlState.name -> str
- property value#
- class State#
Control manager operational state enumeration.
Defines the possible operational states of the control manager, from normal operation to various fault conditions.
Members#
- Unknownint
State is unknown or undefined.
- Idleint
Control manager is idle and ready for commands.
- Enabledint
Control manager is enabled and actively controlling.
- MinorFaultint
Minor fault condition detected.
- MajorFaultint
Major fault condition detected.
Members:
Unknown
Idle
Enabled
MinorFault
MajorFault
- Enabled = <State.Enabled: 2>#
- Idle = <State.Idle: 1>#
- MajorFault = <State.MajorFault: 4>#
- MinorFault = <State.MinorFault: 3>#
- Unknown = <State.Unknown: 0>#
- ControlManagerState.State.name -> str
- property value#
- property control_state#
- property enabled_joint_idx#
- property state#
- property time_scale#
- property unlimited_mode_enabled#
- class rb_sdk.rb_sdk_cpp.rby1.DynamixelBus#
Dynamixel bus communication interface.
This class provides low-level communication with Dynamixel servos including motor control, PID tuning, and status monitoring.
- Variables:
ProtocolVersion (float) – Dynamixel protocol version (2.0).
DefaultBaudrate (int) – Default communication baudrate (2000000).
AddrTorqueEnable (int) – Memory address for torque enable/disable (64).
AddrPresentCurrent (int) – Memory address for current reading (126).
AddrPresentVelocity (int) – Memory address for velocity reading (128).
AddrPresentPosition (int) – Memory address for position reading (132).
AddrGoalCurrent (int) – Memory address for current goal setting (102).
AddrGoalPosition (int) – Memory address for position goal setting (104).
AddrOperatingMode (int) – Memory address for operating mode setting (11).
AddrPresentButtonState (int) – Memory address for button state reading (12).
AddrGoalVibrationLevel (int) – Memory address for vibration level setting (13).
AddrPositionPGain (int) – Memory address for position P gain (80).
AddrPositionIGain (int) – Memory address for position I gain (81).
AddrPositionDGain (int) – Memory address for position D gain (82).
TorqueEnable (int) – Value to enable torque (1).
TorqueDisable (int) – Value to disable torque (0).
CurrentControlMode (int) – Operating mode for current control (0).
CurrentBasedPositionControlMode (int) – Operating mode for current-based position control (5).
AddrCurrentTemperature (int) – Memory address for temperature reading (146).
- AddrCurrentTemperature = 146#
- AddrGoalCurrent = 102#
- AddrGoalPosition = 116#
- AddrGoalVibrationLevel = 102#
- AddrOperatingMode = 11#
- AddrPositionDGain = 80#
- AddrPositionIGain = 82#
- AddrPositionPGain = 84#
- AddrPresentButtonState = 132#
- AddrPresentCurrent = 126#
- AddrPresentPosition = 132#
- AddrPresentVelocity = 128#
- AddrTorqueEnable = 64#
- class ButtonState#
Button state information for gripper devices.
This class represents the state of buttons and triggers on gripper or tool devices.
- Variables:
button (int) – Button state: 0 (released) or 1 (pressed).
trigger (int) – Trigger value ranging from 0 to 255.
- property button#
- property trigger#
- CurrentBasedPositionControlMode = 5#
- CurrentControlMode = 0#
- DefaultBaudrate = 2000000#
- class MotorState#
Motor state information.
This class represents the current state of a Dynamixel motor including position, velocity, current, and temperature.
- Variables:
torque_enable (bool) – Whether torque is currently enabled.
position (float) – Current position [rad].
velocity (float) – Current velocity [rad/s].
current (float) – Current current [A].
torque (float) – Current torque [Nm].
temperature (int) – Current temperature in degrees Celsius.
- property current#
- property position#
- property temperature#
- property torque#
- property torque_enable#
- property velocity#
- class PIDGain#
PID gain parameters for position control.
This class represents the proportional, integral, and derivative gains used for position control of Dynamixel motors.
- Variables:
p_gain (int) – Proportional gain (0-65535).
i_gain (int) – Integral gain (0-65535).
d_gain (int) – Derivative gain (0-65535).
- property d_gain#
- property i_gain#
- property p_gain#
- ProtocolVersion = 2.0#
- TorqueDisable = 0#
- TorqueEnable = 1#
- get_motor_states(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, ids: list[int]) list[tuple[int, rb_sdk.rb_sdk_cpp.rby1.DynamixelBus.MotorState]] | None#
Get motor states for multiple motors.
- Parameters:
ids (list[int]) – List of motor IDs.
- Returns:
List of (id, motor_state) tuples if successful, None otherwise.
- Return type:
list[tuple[int, MotorState]] or None
- get_position_d_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) int | None#
Get position D gain for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
D gain value if successful, None otherwise.
- Return type:
int or None
- get_position_i_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) int | None#
Get position I gain for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
I gain value if successful, None otherwise.
- Return type:
int or None
- get_position_p_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) int | None#
Get position P gain for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
P gain value if successful, None otherwise.
- Return type:
int or None
- get_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) rb_sdk.rb_sdk_cpp.rby1.DynamixelBus.PIDGain | None#
Get position PID gains for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
PIDGain struct if successful, None otherwise.
- Return type:
PIDGain or None
- group_fast_sync_read(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, ids: list[int], addr: int, len: int) list[tuple[int, int]] | None#
Perform fast synchronous read for multiple motors.
- Parameters:
ids (list[int]) – List of motor IDs.
addr (int) – Memory address to read from.
len (int) – Number of bytes to read.
- Returns:
List of (id, value) tuples if successful, None otherwise.
- Return type:
list[tuple[int, int]] or None
- group_fast_sync_read_encoder(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, ids: list[int]) list[tuple[int, float]] | None#
Perform fast synchronous read of encoder values.
- Parameters:
ids (list[int]) – List of motor IDs.
- Returns:
List of (id, encoder_value) tuples if successful, None otherwise.
- Return type:
list[tuple[int, float]] or None
- group_fast_sync_read_operating_mode(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, ids: list[int], use_cache: bool) list[tuple[int, int]] | None#
Perform fast synchronous read of operating modes.
- Parameters:
ids (list[int]) – List of motor IDs.
use_cache (bool, optional) – Whether to use cached values. Default is False.
- Returns:
List of (id, operating_mode) tuples if successful, None otherwise.
- Return type:
list[tuple[int, int]] or None
- group_fast_sync_read_torque_enable(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, ids: list[int]) list[tuple[int, int]] | None#
Perform fast synchronous read of torque enable states.
- Parameters:
ids (list[int]) – List of motor IDs.
- Returns:
List of (id, torque_enable) tuples if successful, None otherwise.
- Return type:
list[tuple[int, int]] or None
- group_sync_write_operating_mode(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id_and_mode_vector: list[tuple[int, int]]) None#
Perform synchronous write of operating modes.
- Parameters:
id_and_mode_vector (list[tuple[int, int]]) – List of (id, mode) tuples.
- group_sync_write_send_position(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id_and_position_vector: list[tuple[int, float]]) None#
Perform synchronous write of goal positions.
- Parameters:
id_and_position_vector (list[tuple[int, int]]) – List of (id, position) tuples.
- group_sync_write_send_torque(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id_and_torque_vector: list[tuple[int, float]]) None#
Perform synchronous write of torque commands.
- Parameters:
id_and_torque_vector (list[tuple[int, float]]) – List of (id, torque) tuples.
- group_sync_write_torque_enable(*args, **kwargs)#
Overloaded function.
group_sync_write_torque_enable(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id_and_enable_vector: list[tuple[int, int]]) -> None
Perform synchronous write of torque enable states.
- Parameters:
id_and_enable_vector (list[tuple[int, int]]) – List of (id, enable) tuples.
group_sync_write_torque_enable(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, ids: list[int], enable: int) -> None
Perform synchronous write of torque enable states.
- Parameters:
ids (list[int]) – List of motor IDs.
enable (int) – Enable value (1=enabled, 0=disabled).
- open_port(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus) bool#
Open the communication port.
- Returns:
True if port opened successfully, False otherwise.
- Return type:
bool
- ping(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) bool#
Ping a motor to check if it’s responding.
- Parameters:
id (int) – Motor ID to ping.
- Returns:
True if motor responds, False otherwise.
- Return type:
bool
- read_button_status(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, arg0: int) tuple[int, rb_sdk.rb_sdk_cpp.rby1.DynamixelBus.ButtonState] | None#
Read button status from a device.
- Parameters:
id (int) – Device ID to read from.
- Returns:
Tuple of (id, button_state) if successful, None otherwise.
- Return type:
tuple[int, ButtonState] or None
- read_encoder(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) float | None#
Read encoder position for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
Encoder position in radians if successful, None otherwise.
- Return type:
float or None
- read_operating_mode(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, use_cache: bool) int | None#
Read operating mode for a motor.
- Parameters:
id (int) – Motor ID.
use_cache (bool, optional) – Whether to use cached value. Default is False.
- Returns:
Operating mode value if successful, None otherwise.
- Return type:
int or None
- read_temperature(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) int | None#
Read temperature for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
Temperature in degrees Celsius if successful, None otherwise.
- Return type:
int or None
- read_torque_enable(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int) int | None#
Read torque enable state for a motor.
- Parameters:
id (int) – Motor ID.
- Returns:
Torque state (1=enabled, 0=disabled) if successful, None otherwise.
- Return type:
int or None
- send_current(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, current: float) None#
Send current command to a motor.
- Parameters:
id (int) – Motor ID.
current (float) – Current value [A].
- send_goal_position(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, goal_position: int) None#
Send goal position to a motor.
- Parameters:
id (int) – Motor ID.
goal_position (int) – Goal position in encoder units.
- send_operating_mode(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, operating_mode: int) bool#
Send operating mode to a motor.
- Parameters:
id (int) – Motor ID.
mode (int) – Operating mode value.
- Returns:
True if successful, False otherwise.
- Return type:
bool
- send_torque(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, torque: float) None#
Send torque command to a motor.
- Parameters:
id (int) – Motor ID.
joint_torque (float) – Torque value [Nm].
- send_torque_enable(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, onoff: int) None#
Enable or disable torque for a motor.
- Parameters:
id (int) – Motor ID.
onoff (int) – Torque state: 1 (enable) or 0 (disable).
- send_vibration(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, vibration: int) None#
Send vibration command to a device.
- Parameters:
id (int) – Device ID.
level (int) – Vibration level (0-255).
- set_baud_rate(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, baudrate: int) bool#
Set the communication baudrate.
- Parameters:
baudrate (int) – Baudrate value (e.g., 2000000).
- Returns:
True if baudrate set successfully, False otherwise.
- Return type:
bool
- set_position_d_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, d_gain: int) None#
Set position D gain for a motor.
- Parameters:
id (int) – Motor ID.
d_gain (int) – D gain value (0-65535).
- set_position_i_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, i_gain: int) None#
Set position I gain for a motor.
- Parameters:
id (int) – Motor ID.
i_gain (int) – I gain value (0-65535).
- set_position_p_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, p_gain: int) None#
Set position P gain for a motor.
- Parameters:
id (int) – Motor ID.
p_gain (int) – P gain value (0-65535).
- set_position_pid_gain(*args, **kwargs)#
Overloaded function.
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, p_gain: Optional[int], i_gain: Optional[int], d_gain: Optional[int]) -> None
Set position PID gains for a motor.
- Parameters:
id (int) – Motor ID.
p_gain (int or None, optional) – P gain value (0-65535). If None, current value is preserved.
i_gain (int or None, optional) – I gain value (0-65535). If None, current value is preserved.
d_gain (int or None, optional) – D gain value (0-65535). If None, current value is preserved.
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, id: int, pid_gain: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus.PIDGain) -> None
Set position PID gains for a motor using PIDGain struct.
- Parameters:
id (int) – Motor ID.
pid_gain (PIDGain) – PIDGain struct containing P, I, and D values.
- set_torque_constant(self: rb_sdk.rb_sdk_cpp.rby1.DynamixelBus, torque_constant: list[float]) None#
Set torque constants for motors.
- Parameters:
torque_constant (list[float]) – List of torque constants for each motor.
- class rb_sdk.rb_sdk_cpp.rby1.EMOInfo#
Emergency stop button information.
This class represents information about an emergency stop button connected to the robot.
- Variables:
name (str) – Name identifier for the emergency stop button.
- property name#
- class rb_sdk.rb_sdk_cpp.rby1.EMOState#
Emergency stop button state.
Provides information about emergency stop button status.
- Variables:
state (State) – Current emergency stop button state.
- class State#
Emergency stop button state enumeration.
Defines the possible emergency stop button states.
Members#
- Releasedint
Emergency stop button is released.
- Pressedint
Emergency stop button is pressed.
Members:
Released
Pressed
- Pressed = <State.Pressed: 1>#
- Released = <State.Released: 0>#
- EMOState.State.name -> str
- property value#
- property state#
- class rb_sdk.rb_sdk_cpp.rby1.FTSensorData#
Force/Torque sensor data.
Provides information about force and torque measurements from a sensor.
- Variables:
time_since_last_update (datetime.timedelta) – Time since last update as a Python timedelta.
force (numpy.ndarray, shape (3,), dtype=float64) – Force readings in N.
torque (numpy.ndarray, shape (3,), dtype=float64) – Torque readings [Nm].
- property force#
- property time_since_last_update#
- property torque#
- class rb_sdk.rb_sdk_cpp.rby1.Feedback#
Base type for all feedback messages.
Use
valid()to check whether the parser filled this feedback instance.- Variables:
valid (bool) – Whether this feedback object contains valid data.
- property valid#
Whether this feedback object contains valid data.
- Returns:
Trueif the parser filled this feedback; otherwiseFalse.- Return type:
bool
- class rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder#
Gravity compensation command builder.
Creates a command that enables or disables gravity compensation on a component (e.g., an arm or the whole body). When enabled, the controller generates feed-forward torques to cancel the effect of gravity so the robot feels weightless.
Examples
>>> import rby1_sdk as rby >>> # Enable gravity compensation for the right arm >>> gc = rby.GravityCompensationCommandBuilder().set_on(True) >>> cmd = rby.RobotCommandBuilder().set_command( ... rby.ArmCommandBuilder().set_command(gc) ... ) >>> # robot.send_command(cmd, priority=1).get()
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_on(self: rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder, on: bool) rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder#
Enable or disable gravity compensation.
- Parameters:
on (bool) –
Trueto enable gravity compensation,Falseto disable.- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandFeedback#
Feedback for a gravity-compensation command.
(Contains only header-level fields via :pyattr:`CommandFeedback.command_header`.)
- class rb_sdk.rb_sdk_cpp.rby1.HeadCommandBuilder#
Head command builder.
Wraps commands for the robot head. Currently, it supports JointPositionCommandBuilder to control the head joints.
Notes
You can pass a JointPositionCommandBuilder directly into
set_head_command(...)without explicitly wrapping it in a HeadCommandBuilder, since implicit casting is provided.Explicit construction is only needed if you want to be verbose; otherwise,
set_head_command(JointPositionCommandBuilder(...))is sufficient.
Examples
>>> import numpy as np, rby1_sdk as rby >>> # Example 1: Explicit HeadCommandBuilder >>> jp = rby.JointPositionCommandBuilder().set_position(np.zeros(2)) # assume 2 DOF head >>> head = rby.HeadCommandBuilder(jp) >>> comp = rby.ComponentBasedCommandBuilder().set_head_command(head) >>> rc = rby.RobotCommandBuilder().set_command(comp) >>> # robot.send_command(rc, priority=1).get() >>> >>> # Example 2: Implicit wrapping (preferred) >>> comp = rby.ComponentBasedCommandBuilder().set_head_command( ... rby.JointPositionCommandBuilder().set_position(np.zeros(2)) ... ) >>> rc = rby.RobotCommandBuilder().set_command(comp)
- set_command(self: rb_sdk.rb_sdk_cpp.rby1.HeadCommandBuilder, joint_position_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.HeadCommandBuilder#
Assign a joint position command to the head.
- Parameters:
joint_position_command_builder (JointPositionCommandBuilder) – Joint position command for the head.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.HeadCommandFeedback#
Feedback for a head command container.
- Variables:
joint_position_command (JointPositionCommandFeedback) – Feedback for a joint position command (if present).
- property joint_position_command#
Head joint position command feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Cartesian impedance control command builder.
Builds a Cartesian impedance command for a given link in a reference frame. The control is formulated in the se(3) space with a 6D error \(\xi = [\,\Delta x;\,\Delta\phi\,] \in \mathbb{R}^6\) (translation and rotation in the Lie algebra), yielding the wrench:
\[w = K\,\xi \;+\; D\,\dot{\xi}\]where \(K \in \mathbb{R}^{6\times 6}\) is the stiffness matrix and \(D \in \mathbb{R}^{6\times 6}\) is the damping matrix.
Notes
The stiffness matrix \(K\) is assumed block-diagonal:
\[K \;=\; \mathrm{diag}(K_t,\; K_r), \qquad K_t, K_r \in \mathbb{R}^{3\times 3}\ \text{(diagonal)}\]set_translation_weight([k_x,k_y,k_z])fills \(K_t=\mathrm{diag}(k_x,k_y,k_z)\), andset_rotation_weight([k_{rx},k_{ry},k_{rz}])fills \(K_r=\mathrm{diag}(k_{rx},k_{ry},k_{rz})\).Damping is derived from a dimensionless ratio \(\zeta\):
\[D \;=\; \zeta \left(\sqrt{M}\sqrt{K} \;+\; \sqrt{K}\sqrt{M}\right),\]with \(M \in \mathbb{R}^{6\times 6}\) the Cartesian inertia matrix.
set_reference_link_nameandset_link_namemust be set before applying the target pose (set_transformation).
Examples
>>> import numpy as np, rby1_sdk as rby >>> T = np.eye(4); T[0,3] = 0.30 # desired pose, 30 cm forward >>> cmd = ( ... rby.ImpedanceControlCommandBuilder() ... .set_reference_link_name("base_link") ... .set_link_name("right_wrist") ... .set_transformation(T) ... .set_translation_weight(np.array([1200.0, 1200.0, 1600.0])) # N/m ... .set_rotation_weight(np.array([60.0, 60.0, 60.0])) # Nm/rad ... .set_damping_ratio(0.7) ... )
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_damping_ratio(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, damping_ratio: float) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Set the (dimensionless) damping ratio used to build the 6×6 damping matrix.
- Parameters:
damping_ratio (float) – Damping ratio \(\zeta\) (typically \(0 < \zeta \le 1.5\)).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Damping in se(3) space is computed from \(K\) and the Cartesian inertia (reflective inertia) \(M\) as:
\[D \;=\; \zeta \left(\sqrt{M}\sqrt{K} \;+\; \sqrt{K}\sqrt{M}\right).\]\(\zeta=1\) approximates critical damping; lower/higher values yield under/over-damped responses.
- set_link_name(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, link_name: str) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Set the controlled link name.
- Parameters:
link_name (str) – Name of the robot link to be regulated in Cartesian impedance.
- Returns:
Self reference for method chaining.
- Return type:
- set_reference_link_name(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, reference_link_name: str) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Set the reference frame (link) name in which the pose is expressed.
- Parameters:
reference_link_name (str) – Reference link/frame name.
- Returns:
Self reference for method chaining.
- Return type:
- set_rotation_weight(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, weight: numpy.ndarray[numpy.float64[3, 1]]) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Set rotational stiffness (fills the rotational block of K).
- Parameters:
weight (numpy.ndarray, shape (3,), dtype=float64) – Per-axis rotational stiffness (Nm/rad), used to form \(K_r=\mathrm{diag}(k_{rx},k_{ry},k_{rz})\).
- Returns:
Self reference for method chaining.
- Return type:
Notes
The rotational wrench component is \(\tau = K_r\,\Delta\phi\).
- set_transformation(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, T: numpy.ndarray[numpy.float64[4, 4]]) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Set the desired Cartesian pose (homogeneous transform).
- Parameters:
T (numpy.ndarray, shape (4,4), dtype=float64) – Desired pose \({}^{ref}\!T^{link}_d\).
- Returns:
Self reference for method chaining.
- Return type:
Notes
The se(3) error \(\xi = [\Delta x;\Delta\phi]\) is computed from \(T_d\) and the current pose.
- set_translation_weight(self: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder, weight: numpy.ndarray[numpy.float64[3, 1]]) rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder#
Set translational stiffness (fills the translational block of K).
- Parameters:
weight (numpy.ndarray, shape (3,), dtype=float64) – Per-axis translational stiffness (N/m), used to form \(K_t=\mathrm{diag}(k_x,k_y,k_z)\).
- Returns:
Self reference for method chaining.
- Return type:
Notes
The 6×6 stiffness matrix is \(K=\mathrm{diag}(K_t,K_r)\).
The translational wrench component is \(F = K_t\,\Delta x\).
- class rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandFeedback#
Feedback for a Cartesian impedance control (single-link) command.
- Variables:
tracking_error (ImpedanceControlCommandFeedback.TrackingError) – Current tracking error (translation/rotation).
- class TrackingError#
Tracking error for Cartesian impedance.
- Variables:
position_error (float) – Translational error magnitude [m].
rotation_error (float) – Rotational error magnitude [rad] (e.g., angle-axis norm).
- property position_error#
- property rotation_error#
- property tracking_error#
Current tracking error.
- Returns:
Translational and rotational error magnitudes.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder#
Jog command builder.
Builds a jog command for a single joint. A jog command applies an incremental position change using one of three types: AbsolutePosition, RelativePosition, or OneStep.
Notes
Jog is an incremental position command, not a velocity command.
To repeat or accumulate jogs on the same joint, send additional jog commands or use a stream command.
Examples
>>> import rby1_sdk as rby >>> jog = ( ... rby.JogCommandBuilder() ... .set_joint_name("right_arm_0") ... .set_command(rby.JogCommandBuilder.RelativePosition(0.1)) ... ) >>> cmd = rby.RobotCommandBuilder().set_command(jog) >>> robot.send_command(cmd, priority=1)
- class AbsolutePosition#
Absolute jog target.
Sets the joint to an absolute angle in radians.
- Parameters:
value (float) – Target absolute joint angle [rad].
Examples
>>> rby.JogCommandBuilder.AbsolutePosition(1.57) # ~90 degrees
- value(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder.AbsolutePosition) float#
Get the target absolute angle in radians.
- class OneStep#
One-step jog target.
Applies a single incremental step to the joint angle in radians. Useful for discrete button/step interfaces.
- Parameters:
value (float) – Step size [rad].
Examples
>>> rby.JogCommandBuilder.OneStep(-0.05) # one step backward
- value(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder.OneStep) bool#
Get the step size in radians.
- class RelativePosition#
Relative jog target.
Offsets the current joint angle by a relative amount in radians.
- Parameters:
value (float) – Relative offset [rad]. Positive values increase the angle; negative values decrease it.
Examples
>>> rby.JogCommandBuilder.RelativePosition(0.1) # +0.1 rad
- value(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder.RelativePosition) float#
Get the relative offset in radians.
- set_acceleration_limit(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, acceleration_limit: float) rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder#
Set the maximum acceleration used during the jog.
- Parameters:
acceleration_limit (float) – Maximum allowed joint acceleration [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
- set_command(*args, **kwargs)#
Overloaded function.
set_command(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, absolute_position: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder.AbsolutePosition) -> rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder
Set the jog as an absolute position target.
- Parameters:
absolute_position (JogCommandBuilder.AbsolutePosition) – Absolute target angle [rad].
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, relative_position: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder.RelativePosition) -> rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder
Set the jog as a relative position target.
- Parameters:
relative_position (JogCommandBuilder.RelativePosition) – Relative offset [rad] from the current joint angle.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, one_step: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder.OneStep) -> rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder
Set the jog as a single incremental step.
- Parameters:
one_step (JogCommandBuilder.OneStep) – Step size [rad] to apply once.
- Returns:
Self reference for method chaining.
- Return type:
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_joint_name(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, joint_name: str) rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder#
Specify the joint to jog.
- Parameters:
joint_name (str) – Name of the single joint to control.
- Returns:
Self reference for method chaining.
- Return type:
- set_velocity_limit(self: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder, velocity_limit: float) rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder#
Set the maximum velocity used during the jog.
- Parameters:
velocity_limit (float) – Maximum allowed joint velocity [rad/s].
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.JogCommandFeedback#
Feedback for a single-joint jog command.
- Variables:
target_joint_name (str) – The name of the jogged joint.
- property target_joint_name#
Name of the jogged joint.
- Returns:
Target joint name.
- Return type:
str
- class rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
Joint group position command builder.
Builds joint position commands for a named subset (group) of joints.
Notes
Vector length rule: For vector arguments (e.g.,
position,velocity_limit,acceleration_limit),Nequals the number of joint names set byset_joint_names(...).
Examples
Command 3 torso joints by name:
>>> import numpy as np, rby1_sdk as rby >>> torso = ( ... rby.JointGroupPositionCommandBuilder() ... .set_joint_names(["torso_3","torso_4","torso_5"]) ... .set_position(np.zeros(3)) # N=3 ... .set_minimum_time(2.0) ... )
- set_acceleration_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder, acceleration_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
Set per-joint acceleration limits for the group.
- Parameters:
acceleration_limit (numpy.ndarray, shape (N,), dtype=float64) – Acceleration limits [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule:
Nequals the number of joint names set byset_joint_names(...).
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
- set_joint_names(self: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder, joint_names: list[str]) rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
Set the joint names that this group command applies to.
- Parameters:
joint_names (list of str) – List of joint name identifiers. The order defines the mapping for subsequent vector arguments such as
position,velocity_limit, andacceleration_limit.- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule: After calling
set_joint_names([...]), the lengthNfor all vector arguments must match the number of names provided. For example, if 6 joint names are given,position,velocity_limit, andacceleration_limitmust all be length 6.
Examples
>>> import numpy as np, rby1_sdk as rby >>> torso = ( ... rby.JointGroupPositionCommandBuilder() ... .set_joint_names(["torso_0","torso_1","torso_2","torso_3","torso_4","torso_5"]) ... .set_position(np.zeros(6)) # N=6 ... .set_velocity_limit(np.full(6, 1.0)) ... .set_acceleration_limit(np.full(6, 2.0)) ... .set_minimum_time(2.0) ... )
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
Set the minimum execution time for the motion.
- Parameters:
minimum_time (float) –
The shortest allowed duration (in seconds) to reach the target.
If the motion profile based on velocity/acceleration limits would finish earlier, the motion is slowed down to take exactly minimum_time.
If the natural motion takes longer than minimum_time, this parameter is ignored.
This parameter provides an additional degree of freedom to control arrival time. Instead of relying solely on velocity and acceleration limits, you can set high limits and then enforce the desired duration using minimum_time.
For streaming commands, this prevents the robot from arriving too early and waiting idly, thereby ensuring smooth and continuous motion.
- Returns:
Self reference for method chaining.
- Return type:
- set_position(self: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder, position: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
Set group joint target positions in radians.
- Parameters:
position (numpy.ndarray, shape (N,), dtype=float64) – Target joint positions (radians) for the group.
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule:
Nequals the number of joint names set byset_joint_names(...).
- set_velocity_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder, velocity_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder#
Set per-joint velocity limits for the group.
- Parameters:
velocity_limit (numpy.ndarray, shape (N,), dtype=float64) – Velocity limits [rad/s].
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule:
Nequals the number of joint names set byset_joint_names(...).
- class rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandFeedback#
Feedback for a joint group position command.
- Variables:
joint_indices (list[int]) – Indices of the joints targeted by this group command (model order).
time_based_progress (float) – Progress estimate [0.0, 1.0] based on time.
position_based_progress (float) – Progress estimate [0.0, 1.0] based on position error reduction.
- property joint_indices#
Indices of the joints in the group command.
- Returns:
Model-order joint indices.
- Return type:
list[int]
- property position_based_progress#
Position-based progress estimate.
- Returns:
Value in [0.0, 1.0].
- Return type:
float
- property time_based_progress#
Time-based progress estimate.
- Returns:
Value in [0.0, 1.0].
- Return type:
float
- class rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Joint impedance control command builder.
Creates joint-space impedance commands with position targets, stiffness, damping ratio, optional velocity/acceleration limits, and per-joint torque limits.
Notes
Vector length rule: All vector arguments (
position,stiffness,torque_limit,velocity_limit,acceleration_limit) must have length \(N\) equal to the DOF of the component where this builder is applied.Examples (Model
A):set_right_arm_command(...)→ right arm has \(N=7\)set_body_command(...)→ whole body has \(N=20\)
Impedance control model:
\[\tau = K (q_d - q) + D (\dot{q}_d - \dot{q}) + \tau_{ff}\]with \(K\) (stiffness), \(D\) (damping), and \(\tau_{ff}\) the feed-forward torque.
Damping from damping ratio \(\zeta\):
\[D = \zeta \left( \sqrt{M}\sqrt{K} + \sqrt{K}\sqrt{M} \right)\]where \(M\) is the (joint) inertia matrix.
Feed-forward torque \(\tau_{ff}\) is the gravity compensation torque. The final applied torque is saturated by the per-joint limits:
\[\tau_{applied} = \mathrm{clip}(\tau,\; -\tau_{max},\; \tau_{max})\]
Examples
Compliant positioning on one arm (Model A):
>>> import numpy as np, rby1_sdk as rby >>> imp = ( ... rby.JointImpedanceControlCommandBuilder() ... .set_position(np.zeros(7)) # N=7 ... .set_stiffness(np.full(7, 50.0)) # Nm/rad ... .set_damping_ratio(0.7) # ζ ... .set_torque_limit(np.full(7, 60.0)) # Nm ... .set_velocity_limit(np.full(7, np.pi)) # rad/s ... .set_acceleration_limit(np.full(7, 2.0)) # rad/s² ... .set_minimum_time(1.0) # s ... )
- set_acceleration_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, acceleration_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set per-joint acceleration limits.
- Parameters:
acceleration_limit (numpy.ndarray, shape (N,), dtype=float64) – Acceleration limits [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length \(N\) must match the component DOF.
If not set, limits from the current robot URDF are used (see
get_robot_model).Values beyond hardware capability may be accepted for profiling; actual tracking is not guaranteed.
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Attach a command header to this builder.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
Examples
>>> header = rby.CommandHeaderBuilder().set_control_hold_time(3.0) >>> imp = rby.JointImpedanceControlCommandBuilder().set_command_header(header)
- set_damping_ratio(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, damping_ratio: float) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set the damping ratio.
- Parameters:
damping_ratio (float) – Damping ratio \(\zeta\) (dimensionless) in [0, 1].
- Returns:
Self reference for method chaining.
- Return type:
Notes
The damping matrix is computed from \(\zeta\), stiffness \(K\), and inertia \(M\):
\[D = \zeta \left( \sqrt{M}\sqrt{K} + \sqrt{K}\sqrt{M} \right)\]
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set the minimum execution time for the motion.
- Parameters:
minimum_time (float) –
The shortest allowed duration (in seconds) to reach the target.
If the motion profile based on velocity/acceleration limits would finish earlier, the motion is slowed down to take exactly minimum_time.
If the natural motion takes longer than minimum_time, this parameter is ignored.
This parameter provides an additional degree of freedom to control arrival time. Instead of relying solely on velocity and acceleration limits, you can set high limits and then enforce the desired duration using minimum_time.
For streaming commands, this prevents the robot from arriving too early and waiting idly, thereby ensuring smooth and continuous motion.
- Returns:
Self reference for method chaining.
- Return type:
- set_position(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, position: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set target joint positions.
- Parameters:
position (numpy.ndarray, shape (N,), dtype=float64) – Desired joint positions \(q_d\) [rad]
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length \(N\) must match the DOF of the target component (e.g., Model A arm \(N=7\), whole body \(N=20\)).
- set_stiffness(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, stiffness: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set per-joint stiffness values.
- Parameters:
stiffness (numpy.ndarray, shape (N,), dtype=float64) – Per-joint stiffness values, interpreted as the diagonal elements of the stiffness matrix \(K \in \mathbb{R}^{N \times N}\) (Nm/rad).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length \(N\) must match the component DOF.
The full stiffness matrix is assumed to be diagonal:
\[K = \mathrm{diag}(k_1, k_2, \ldots, k_N)\]Stiffness contributes torque as:
\[\tau_K = K (q_d - q)\]
- set_torque_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, torque_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set per-joint torque limits.
- Parameters:
torque_limit (numpy.ndarray, shape (N,), dtype=float64) – Maximum allowable torque \(\tau_{max}\) [Nm].
- Returns:
Self reference for method chaining.
- Return type:
Notes
The controller torque is:
\[\tau = K (q_d - q) + D (\dot{q}_d - \dot{q}) + \tau_{ff}\]where \(\tau_{ff}\) is the feed-forward gravity compensation torque.
The applied torque is saturated per joint:
\[\tau_{applied} = \mathrm{clip}(\tau,\; -\tau_{max},\; \tau_{max})\]
- set_velocity_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder, velocity_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder#
Set per-joint velocity limits.
- Parameters:
velocity_limit (numpy.ndarray, shape (N,), dtype=float64) – Velocity limits [rad/s].
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length \(N\) must match the component DOF.
If not set, limits from the current robot URDF are used (see
get_robot_model).Values beyond hardware capability may be accepted for profiling; actual tracking is not guaranteed.
- class rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandFeedback#
Feedback for a joint-space impedance control command.
- Variables:
set_position (list[float]) – Current joint setpoints [rad].
error (list[float]) – Joint-space errors (q_d - q) [rad].
- property error#
Joint-space errors.
- Returns:
Per-joint position errors [rad].
- Return type:
list[float]
- property set_position#
Current joint setpoints.
- Returns:
Joint setpoints [rad].
- Return type:
list[float]
- class rb_sdk.rb_sdk_cpp.rby1.JointInfo#
Joint information.
Stores hardware/firmware metadata for a single joint.
- Variables:
name (str) – Joint name (e.g., “right_arm_2”).
has_brake (bool) – Whether the joint includes a brake.
product_name (str) – Actuator/driver product name.
firmware_version (str) – Firmware revision running on the motor driver / servo drive.
- property firmware_version#
- property has_brake#
- property name#
- property product_name#
- class rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder#
Joint position command builder.
Builds joint position commands with optional velocity/acceleration limits and a minimum execution time.
Notes
Vector length rule: For any vector argument (e.g.,
position,velocity_limit,acceleration_limit), the length N must equal the DOF of the component this builder commands. Examples: -set_right_arm_command(...)on modelA→ right arm N = 7 -set_body_command(...)on modelA→ body N = 20
Examples
Move the right arm to zero with limits and a 3-second minimum time:
>>> import numpy as np, rby1_sdk as rby >>> jp = ( ... rby.JointPositionCommandBuilder() ... .set_position(np.zeros(7)) # N=7 (right arm) ... .set_velocity_limit(np.full(7, np.pi)) # rad/s ... .set_acceleration_limit(np.full(7, 1.0)) # rad/s^2 ... .set_minimum_time(3.0) ... ) >>> body = rby.BodyComponentBasedCommandBuilder().set_right_arm_command( ... rby.ArmCommandBuilder().set_command(jp) ... ) >>> rc = rby.RobotCommandBuilder().set_command( ... rby.ComponentBasedCommandBuilder().set_body_command(body) ... ) >>> # Send with priority 10 >>> # robot.send_command(rc, 10).get()
- set_acceleration_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder, acceleration_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder#
Set joint acceleration limits.
- Parameters:
acceleration_limit (numpy.ndarray, shape (N,), dtype=float64) – Per-joint acceleration limits [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule:
Nmust equal the DOF of the commanded component (e.g., modelAright armN=7, full bodyN=20).If not set, URDF limits for the current robot model are used (see
get_robot_model).Values beyond hardware limits may be accepted for profiling; actual tracking is not guaranteed.
Examples
>>> import numpy as np, rby1_sdk as rby >>> jp = rby.JointPositionCommandBuilder().set_acceleration_limit(np.full(7, 1.0))
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder#
Set the command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header builder.
- Returns:
Self reference for method chaining.
- Return type:
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder#
Set the minimum execution time for the motion.
- Parameters:
minimum_time (float) –
The shortest allowed duration (in seconds) to reach the target.
If the motion profile based on velocity/acceleration limits would finish earlier, the motion is slowed down to take exactly minimum_time.
If the natural motion takes longer than minimum_time, this parameter is ignored.
This parameter provides an additional degree of freedom to control arrival time. Instead of relying solely on velocity and acceleration limits, you can set high limits and then enforce the desired duration using minimum_time.
For streaming commands, this prevents the robot from arriving too early and waiting idly, thereby ensuring smooth and continuous motion.
- Returns:
Self reference for method chaining.
- Return type:
- set_position(self: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder, position: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder#
Set the target joint positions in radians.
- Parameters:
position (numpy.ndarray, shape (N,), dtype=float64) – Target joint positions [rad]
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule:
Nmust equal the DOF of the commanded component. Examples on modelA: right arm →N=7; full body →N=20.Examples
>>> import numpy as np, rby1_sdk as rby >>> jp = rby.JointPositionCommandBuilder().set_position(np.zeros(7)) # right arm
- set_velocity_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder, velocity_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder#
Set joint velocity limits.
- Parameters:
velocity_limit (numpy.ndarray, shape (N,), dtype=float64) – Per-joint velocity limits [rad/s].
- Returns:
Self reference for method chaining.
- Return type:
Notes
Vector length rule:
Nmust equal the DOF of the commanded component (e.g., modelAright armN=7, full bodyN=20).If not set, URDF limits for the current robot model are used (see
get_robot_model).Values beyond hardware limits may be accepted for profiling; actual tracking is not guaranteed.
Examples
>>> import numpy as np, rby1_sdk as rby >>> jp = rby.JointPositionCommandBuilder().set_velocity_limit(np.full(7, np.pi))
- class rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandFeedback#
Feedback for a joint-space position command.
- Variables:
time_based_progress (float) – Progress estimate [0.0, 1.0] based on time.
position_based_progress (float) – Progress estimate [0.0, 1.0] based on position error reduction.
- property position_based_progress#
Position-based progress estimate.
- Returns:
Value in [0.0, 1.0].
- Return type:
float
- property time_based_progress#
Time-based progress estimate.
- Returns:
Value in [0.0, 1.0].
- Return type:
float
- class rb_sdk.rb_sdk_cpp.rby1.JointState#
Joint state information.
Provides information about the state of a single joint, including its readiness, FET state, run state, initialization state, motor type, motor state, power, position, velocity, current, torque, and target values.
- Variables:
time_since_last_update (datetime.timedelta) – Time since last update as a Python timedelta.
is_ready (bool) – Indicates if the joint is ready to operate.
fet_state (FETState) – Current FET state of the joint.
run_state (RunState) – Current run state of the joint.
init_state (InitializationState) – Current initialization state of the joint.
motor_type (str) – Type of the joint’s motor.
motor_state (str) – Current state of the joint’s motor.
power_on (bool) – Indicates if the joint’s power is on.
position (float) – Current position of the joint [rad].
velocity (float) – Current velocity of the joint [rad/s].
current (float) – Current current of the joint [A].
torque (float) – Current torque of the joint in Nm.
target_position (float) – Target position of the joint [rad].
target_velocity (float) – Target velocity of the joint [rad/s].
target_feedback_gain (float) – Target feedback gain of the joint.
target_feedforward_torque (float) – Target feedforward torque of the joint.
temperature (float) – Current temperature of the joint in °C.
- class FETState#
FET (power stage) state.
Members#
- Unknownint
State is unknown or not reported.
- Onint
Power stage is enabled.
- Offint
Power stage is disabled.
Members:
Unknown
On
Off
- Off = <FETState.Off: 2>#
- On = <FETState.On: 1>#
- Unknown = <FETState.Unknown: 0>#
- JointState.FETState.name -> str
- property value#
- class InitializationState#
Initialization state of the joint.
Members#
- Unknownint
Initialization state is unknown.
- Initializedint
Joint has been initialized/homed.
- Uninitializedint
Joint has not been initialized/homed yet.
Members:
Unknown
Initialized
Uninitialized
- Initialized = <InitializationState.Initialized: 1>#
- Uninitialized = <InitializationState.Uninitialized: 2>#
- Unknown = <InitializationState.Unknown: 0>#
- JointState.InitializationState.name -> str
- property value#
- class RunState#
Current run state of the joint.
Members#
- Unknownint
State is unknown or not reported.
- ControlOnint
Closed-loop control is enabled (actively controlling).
- ControlOffint
Closed-loop control is disabled.
Members:
Unknown
ControlOn
ControlOff
- ControlOff = <RunState.ControlOff: 2>#
- ControlOn = <RunState.ControlOn: 1>#
- Unknown = <RunState.Unknown: 0>#
- JointState.RunState.name -> str
- property value#
- property current#
- property fet_state#
- property init_state#
- property is_ready#
- property motor_state#
- property motor_type#
- property position#
- property power_on#
- property run_state#
- property target_feedback_gain#
- property target_feedforward_torque#
- property target_position#
- property target_velocity#
- property temperature#
- property time_since_last_update#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder#
Joint velocity command builder.
Builds a joint-space velocity command with optional acceleration limits. When a target velocity vector \(v_d\) is set, the command generates a linear ramp from the current velocity \(v_{curr}\) to \(v_d\), considering both acceleration limits and the specified minimum time.
The controller’s objective is to reach the target velocity. If you need the robot to hold the target velocity after reaching it, you must specify a control hold time in the command header.
Examples
>>> import numpy as np, rby1_sdk as rby >>> # Ramp torso joints to 0.5 rad/s with acceleration limits >>> cmd = ( ... rby.JointVelocityCommandBuilder() ... .set_velocity(np.full(6, 0.5)) ... .set_acceleration_limit(np.full(6, 2.0)) ... .set_minimum_time(1.0) ... ) >>> # To maintain the velocity after reaching 0.5 rad/s, >>> # add a CommandHeader with control_hold_time. >>> header = rby.CommandHeaderBuilder().set_control_hold_time(5.0) >>> cmd.set_command_header(header)
- set_acceleration_limit(self: rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder, acceleration_limit: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder#
Set per-joint acceleration limits.
- Parameters:
acceleration_limit (numpy.ndarray, shape (N,), dtype=float64) – Maximum allowable accelerations [rad/s²]. Length \(N\) must equal the number of joints in the targeted component.
- Returns:
Self reference for method chaining.
- Return type:
Notes
These limits shape the linear ramp profile toward the target velocity.
If not set, URDF defaults are used (see
get_robot_model).
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Use
control_hold_timeto maintain the commanded velocity once reached.
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder#
Set the minimum execution time.
- Parameters:
minimum_time (float) – Minimum execution time in seconds. Ensures the ramping process to the target velocity is stretched at least over this duration.
- Returns:
Self reference for method chaining.
- Return type:
- set_velocity(self: rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder, velocity: numpy.ndarray[numpy.float64[m, 1]]) rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder#
Set desired joint velocities.
- Parameters:
velocity (numpy.ndarray, shape (N,), dtype=float64) – Per-joint target velocities [rad/s]. Length \(N\) must equal the number of joints in the targeted component.
- Returns:
Self reference for method chaining.
- Return type:
Notes
The command ramps linearly from the current velocity to the target velocity.
To hold the target velocity after reaching it, add a command header with a control hold time.
- class rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandFeedback#
Feedback for a joint-space velocity command.
(Contains only header-level fields via :pyattr:`CommandFeedback.command_header`.)
- class rb_sdk.rb_sdk_cpp.rby1.Log#
Robot log entry with timestamp and message.
This class represents a single log entry from the robot system, including timestamps, log level, and message content.
- Variables:
timestamp (datetime.datetime) – Timestamp when the log was created (client system time).
robot_system_timestamp (datetime.datetime) – Timestamp when the log was created (robot system time).
level (Level) – Log level indicating the severity of the message.
message (str) – The log message content.
- class Level#
Log level enumeration.
Defines the severity levels for log messages, from least to most severe.
Members#
- Traceint
Trace level for detailed debugging information.
- Debugint
Debug level for debugging information.
- Infoint
Info level for general information messages.
- Warnint
Warning level for warning messages.
- Errorint
Error level for error messages.
- Criticalint
Critical level for critical error messages.
Members:
Trace
Debug
Info
Warn
Error
Critical
- Critical = <Level.Critical: 5>#
- Debug = <Level.Debug: 1>#
- Error = <Level.Error: 4>#
- Info = <Level.Info: 2>#
- Trace = <Level.Trace: 0>#
- Warn = <Level.Warn: 3>#
- Log.Level.name -> str
- property value#
- property level#
- property message#
- property robot_system_timestamp#
- property timestamp#
- class rb_sdk.rb_sdk_cpp.rby1.MobilityCommandBuilder#
Mobility command builder.
Wraps commands for the robot’s mobility subsystem. It supports both joint-space velocity commands (e.g., differential/mecanum wheels) and planar SE(2) velocity commands.
Notes
Typically used inside
set_mobility_command(...)of a ComponentBasedCommandBuilder.You do not need to explicitly construct MobilityCommandBuilder if passing a JointVelocityCommandBuilder or SE2VelocityCommandBuilder, as implicit casting will wrap them automatically.
Examples
>>> import numpy as np, rby1_sdk as rby >>> # Example 1: Joint velocity mobility (e.g., wheel joints) >>> vel = rby.JointVelocityCommandBuilder().set_velocity(np.full(4, 1.0)) >>> mobility = rby.MobilityCommandBuilder().set_command(vel) >>> comp = rby.ComponentBasedCommandBuilder().set_mobility_command(mobility) >>> rc = rby.RobotCommandBuilder().set_command(comp) >>> # robot.send_command(rc, priority=1).get() >>> >>> # Example 2: SE(2) velocity mobility >>> se2 = rby.SE2VelocityCommandBuilder().set_velocity(np.array([0.2, 0.0]), 0.1) # vx=0.2 m/s, yaw=0.1 rad/s >>> comp = rby.ComponentBasedCommandBuilder().set_mobility_command(se2) # implicit wrap >>> rc = rby.RobotCommandBuilder().set_command(comp)
- set_command(*args, **kwargs)#
Overloaded function.
set_command(self: rb_sdk.rb_sdk_cpp.rby1.MobilityCommandBuilder, joint_velocity_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointVelocityCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.MobilityCommandBuilder
Assign a joint velocity command.
- Parameters:
joint_velocity_command_builder (JointVelocityCommandBuilder) – Joint-space velocity command (rad/s for each mobility joint).
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.MobilityCommandBuilder, se2_velocity_command_builder: rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.MobilityCommandBuilder
Assign an SE(2) velocity command.
- Parameters:
se2_velocity_command_builder (SE2VelocityCommandBuilder) – Planar velocity command with linear [m/s] and angular [rad/s] components.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.MobilityCommandFeedback#
Feedback for a mobility command container.
- Variables:
joint_velocity_command (JointVelocityCommandFeedback) – Feedback for a joint velocity command (if present).
se2_velocity_command (SE2VelocityCommandFeedback) – Feedback for a base SE(2) velocity command (if present).
- property joint_velocity_command#
Joint velocity command feedback.
- Returns:
Feedback object.
- Return type:
- property se2_velocity_command#
SE(2) velocity command feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.Model_A#
Robot model configuration (
A).This class provides access to robot model specifications including joint configurations, degrees of freedom, and component indices.
- Variables:
model_name (str) –
‘A’
Name identifier for the robot model.
robot_dof (int) –
24
Total degrees of freedom.
robot_joint_names (list[str]) –
[‘right_wheel’, ‘left_wheel’, ‘torso_0’, ‘torso_1’, ‘torso_2’, ‘torso_3’, ‘torso_4’, ‘torso_5’, ‘right_arm_0’, ‘right_arm_1’, ‘right_arm_2’, ‘right_arm_3’, ‘right_arm_4’, ‘right_arm_5’, ‘right_arm_6’, ‘left_arm_0’, ‘left_arm_1’, ‘left_arm_2’, ‘left_arm_3’, ‘left_arm_4’, ‘left_arm_5’, ‘left_arm_6’, ‘head_0’, ‘head_1’]
List of joint names in index order.
mobility_idx (list[int]) –
[0, 1]
Indices of mobility components (e.g., wheels).
body_idx (list[int]) –
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
Indices of main body components (excluding mobility and head).
head_idx (list[int]) –
[22, 23]
Indices of head components.
right_arm_idx (list[int]) –
[8, 9, 10, 11, 12, 13, 14]
Indices of right arm components.
left_arm_idx (list[int]) –
[15, 16, 17, 18, 19, 20, 21]
Indices of left arm components.
torso_idx (list[int]) –
[2, 3, 4, 5, 6, 7]
Indices of torso components.
velocity_estimation_required_idx (list[int]) –
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
Indices of joints requiring velocity estimation.
control_period (float) –
0.002000
Control update period in seconds.
- property body_idx#
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
Indices of main body components (excluding mobility and head).
- property control_period#
0.002000
Control period in seconds.
- property head_idx#
[22, 23]
Indices of head components.
- property left_arm_idx#
[15, 16, 17, 18, 19, 20, 21]
Indices of left arm components.
- property mobility_idx#
[0, 1]
Indices of mobility components (e.g., wheels).
- property model_name#
‘A’
Name identifier for the robot model.
- property right_arm_idx#
[8, 9, 10, 11, 12, 13, 14]
Indices of right arm components.
- property robot_dof#
24
Total degrees of freedom.
- property robot_joint_names#
[‘right_wheel’, ‘left_wheel’, ‘torso_0’, ‘torso_1’, ‘torso_2’, ‘torso_3’, ‘torso_4’, ‘torso_5’, ‘right_arm_0’, ‘right_arm_1’, ‘right_arm_2’, ‘right_arm_3’, ‘right_arm_4’, ‘right_arm_5’, ‘right_arm_6’, ‘left_arm_0’, ‘left_arm_1’, ‘left_arm_2’, ‘left_arm_3’, ‘left_arm_4’, ‘left_arm_5’, ‘left_arm_6’, ‘head_0’, ‘head_1’]
List of joint names in index order.
- property torso_idx#
[2, 3, 4, 5, 6, 7]
Indices of torso components.
- property velocity_estimation_required_idx#
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
Indices of joints where velocity estimation is essential.
- class rb_sdk.rb_sdk_cpp.rby1.Model_M#
Robot model configuration (
M).This class provides access to robot model specifications including joint configurations, degrees of freedom, and component indices.
- Variables:
model_name (str) –
‘M’
Name identifier for the robot model.
robot_dof (int) –
26
Total degrees of freedom.
robot_joint_names (list[str]) –
[‘wheel_fr’, ‘wheel_fl’, ‘wheel_rr’, ‘wheel_rl’, ‘torso_0’, ‘torso_1’, ‘torso_2’, ‘torso_3’, ‘torso_4’, ‘torso_5’, ‘right_arm_0’, ‘right_arm_1’, ‘right_arm_2’, ‘right_arm_3’, ‘right_arm_4’, ‘right_arm_5’, ‘right_arm_6’, ‘left_arm_0’, ‘left_arm_1’, ‘left_arm_2’, ‘left_arm_3’, ‘left_arm_4’, ‘left_arm_5’, ‘left_arm_6’, ‘head_0’, ‘head_1’]
List of joint names in index order.
mobility_idx (list[int]) –
[0, 1, 2, 3]
Indices of mobility components (e.g., wheels).
body_idx (list[int]) –
[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
Indices of main body components (excluding mobility and head).
head_idx (list[int]) –
[24, 25]
Indices of head components.
right_arm_idx (list[int]) –
[10, 11, 12, 13, 14, 15, 16]
Indices of right arm components.
left_arm_idx (list[int]) –
[17, 18, 19, 20, 21, 22, 23]
Indices of left arm components.
torso_idx (list[int]) –
[4, 5, 6, 7, 8, 9]
Indices of torso components.
velocity_estimation_required_idx (list[int]) –
[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
Indices of joints requiring velocity estimation.
control_period (float) –
0.002000
Control update period in seconds.
- property body_idx#
[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
Indices of main body components (excluding mobility and head).
- property control_period#
0.002000
Control period in seconds.
- property head_idx#
[24, 25]
Indices of head components.
- property left_arm_idx#
[17, 18, 19, 20, 21, 22, 23]
Indices of left arm components.
- property mobility_idx#
[0, 1, 2, 3]
Indices of mobility components (e.g., wheels).
- property model_name#
‘M’
Name identifier for the robot model.
- property right_arm_idx#
[10, 11, 12, 13, 14, 15, 16]
Indices of right arm components.
- property robot_dof#
26
Total degrees of freedom.
- property robot_joint_names#
[‘wheel_fr’, ‘wheel_fl’, ‘wheel_rr’, ‘wheel_rl’, ‘torso_0’, ‘torso_1’, ‘torso_2’, ‘torso_3’, ‘torso_4’, ‘torso_5’, ‘right_arm_0’, ‘right_arm_1’, ‘right_arm_2’, ‘right_arm_3’, ‘right_arm_4’, ‘right_arm_5’, ‘right_arm_6’, ‘left_arm_0’, ‘left_arm_1’, ‘left_arm_2’, ‘left_arm_3’, ‘left_arm_4’, ‘left_arm_5’, ‘left_arm_6’, ‘head_0’, ‘head_1’]
List of joint names in index order.
- property torso_idx#
[4, 5, 6, 7, 8, 9]
Indices of torso components.
- property velocity_estimation_required_idx#
[4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
Indices of joints where velocity estimation is essential.
- class rb_sdk.rb_sdk_cpp.rby1.Model_UB#
Robot model configuration (
UB).This class provides access to robot model specifications including joint configurations, degrees of freedom, and component indices.
- Variables:
model_name (str) –
‘UB’
Name identifier for the robot model.
robot_dof (int) –
18
Total degrees of freedom.
robot_joint_names (list[str]) –
[‘torso_hp’, ‘torso_5’, ‘right_arm_0’, ‘right_arm_1’, ‘right_arm_2’, ‘right_arm_3’, ‘right_arm_4’, ‘right_arm_5’, ‘right_arm_6’, ‘left_arm_0’, ‘left_arm_1’, ‘left_arm_2’, ‘left_arm_3’, ‘left_arm_4’, ‘left_arm_5’, ‘left_arm_6’, ‘head_0’, ‘head_1’]
List of joint names in index order.
mobility_idx (list[int]) –
[]
Indices of mobility components (e.g., wheels).
body_idx (list[int]) –
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Indices of main body components (excluding mobility and head).
head_idx (list[int]) –
[16, 17]
Indices of head components.
right_arm_idx (list[int]) –
[2, 3, 4, 5, 6, 7, 8]
Indices of right arm components.
left_arm_idx (list[int]) –
[9, 10, 11, 12, 13, 14, 15]
Indices of left arm components.
torso_idx (list[int]) –
[0, 1]
Indices of torso components.
velocity_estimation_required_idx (list[int]) –
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Indices of joints requiring velocity estimation.
control_period (float) –
0.002000
Control update period in seconds.
- property body_idx#
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Indices of main body components (excluding mobility and head).
- property control_period#
0.002000
Control period in seconds.
- property head_idx#
[16, 17]
Indices of head components.
- property left_arm_idx#
[9, 10, 11, 12, 13, 14, 15]
Indices of left arm components.
- property mobility_idx#
[]
Indices of mobility components (e.g., wheels).
- property model_name#
‘UB’
Name identifier for the robot model.
- property right_arm_idx#
[2, 3, 4, 5, 6, 7, 8]
Indices of right arm components.
- property robot_dof#
18
Total degrees of freedom.
- property robot_joint_names#
[‘torso_hp’, ‘torso_5’, ‘right_arm_0’, ‘right_arm_1’, ‘right_arm_2’, ‘right_arm_3’, ‘right_arm_4’, ‘right_arm_5’, ‘right_arm_6’, ‘left_arm_0’, ‘left_arm_1’, ‘left_arm_2’, ‘left_arm_3’, ‘left_arm_4’, ‘left_arm_5’, ‘left_arm_6’, ‘head_0’, ‘head_1’]
List of joint names in index order.
- property torso_idx#
[0, 1]
Indices of torso components.
- property velocity_estimation_required_idx#
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Indices of joints where velocity estimation is essential.
- class rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Optimal control command builder.
Constructs an optimal control objective composed of Cartesian pose costs, center-of-mass (COM) costs, and joint position costs, with global error and limit scalings.
Notes
The overall objective can be viewed as a weighted least-squares form:
\[J \;=\; \sum_{i} w_t^{(i)} \,\|\, p^{(i)}_d - p^{(i)} \,\|^2 \;+\; \sum_{i} w_r^{(i)} \,\|\, r^{(i)}_d \ominus r^{(i)} \,\|^2 \;+\; w_{\mathrm{com}} \,\|\, c_d - c \,\|^2 \;+\; \sum_j w_q^{(j)} \,(q^{(j)}_d - q^{(j)})^2\]where \(p, r\) denote translation and rotation of a link in a reference frame, \(c\) is the COM position, and \(q\) are joint positions.
Velocity/acceleration limit scalings multiply internal limits used by the optimizer; they do not redefine hardware limits.
Examples
Set a right-wrist Cartesian target and a joint hint, with moderate limit scalings:
>>> import numpy as np, rby1_sdk as rby >>> T = np.eye(4); T[0,3] = 0.35; T[2,3] = 0.55 >>> oc = ( ... rby.OptimalControlCommandBuilder() ... .add_cartesian_target("base_link", "ee_right", T, translation_weight=1.0, rotation_weight=0.5) ... .add_joint_position_target("right_arm_4", 0.4, weight=0.2) ... .set_velocity_limit_scaling(0.8) ... .set_acceleration_limit_scaling(0.6) ... .set_error_scaling(1.0) ... )
- add_cartesian_target(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, ref_link_name: str, link_name: str, T: numpy.ndarray[numpy.float64[4, 4]], translation_weight: float, rotation_weight: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Add a Cartesian pose target for a link.
- Parameters:
ref_link_name (str) – Reference frame (link) name in which the target pose is expressed.
link_name (str) – Controlled link name.
T (numpy.ndarray, shape (4,4), dtype=float64) – Target homogeneous transform \({}^{ref}\!T^{link}_d\).
translation_weight (float) – Weight \(w_t\) for translational error.
rotation_weight (float) – Weight \(w_r\) for rotational error.
- Returns:
Self reference for method chaining.
- Return type:
Notes
The cost terms are typically of the form
\[J_t = w_t \, \|\, p_d - p \,\|^2, \qquad J_r = w_r \, \|\, r_d \ominus r \,\|^2,\]where \(p\) is position and \(r\) is orientation (e.g., axis-angle error) of
link_namemeasured inref_link_name.
- add_joint_position_target(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, joint_name: str, target_position: float, weight: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Add a joint position target.
- Parameters:
joint_name (str) – Joint name.
target_position (float) – Desired joint position \(q_d\) [rad].
weight (float) – Weight \(w_q\) for this joint’s position error.
- Returns:
Self reference for method chaining.
- Return type:
Notes
The joint cost term is:
\[J_q \;=\; w_q \,(q_d - q)^2 .\]
- set_acceleration_limit_scaling(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, acceleration_limit_scaling: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Scale internal joint acceleration limits used by the optimizer.
- Parameters:
acceleration_limit_scaling (float) – Scaling factor \(\alpha_a > 0\). The internal acceleration limits become \(\alpha_a \cdot a_{\max}\).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Like velocity scaling, this only affects internal optimization constraints.
- set_center_of_mass_target(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, ref_link_name: str, pose: numpy.ndarray[numpy.float64[3, 1]], weight: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Set a center-of-mass (COM) position target.
- Parameters:
ref_link_name (str) – Reference frame (link) name for the COM target.
pose (numpy.ndarray, shape (3,), dtype=float64) – Desired COM position \(c_d = [x,y,z]^\\top\) in meters, expressed in
ref_link_name.weight (float) – Weight \(w_{\mathrm{com}}\) for COM position error.
- Returns:
Self reference for method chaining.
- Return type:
Notes
The COM cost is:
\[J_{\mathrm{com}} \;=\; w_{\mathrm{com}} \,\|\, c_d - c \,\|^2 .\]
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Attach a command header to this builder.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_error_scaling(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, error_scaling: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Set a global error scaling applied to cost terms.
- Parameters:
error_scaling (float) – A positive scalar multiplying error magnitudes internally (e.g., to balance different unit scales).
- Returns:
Self reference for method chaining.
- Return type:
Notes
Conceptually, this scales error vectors before squaring, e.g., \(e \leftarrow \alpha e\), which yields \(\alpha^2\) scaling on quadratic costs.
- set_min_delta_cost(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, min_delta_cost: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Set the minimum required improvement in cost between iterations.
- Parameters:
min_delta_cost (float) – If the reduction \(\Delta J\) between iterations drops below this value, the optimizer may stop (convergence).
- Returns:
Self reference for method chaining.
- Return type:
- set_patience(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, patience: int) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Set the iteration patience before stopping on small improvements.
- Parameters:
patience (int) – Number of iterations to tolerate without sufficient cost improvement (in combination with
set_min_delta_cost).- Returns:
Self reference for method chaining.
- Return type:
- set_stop_cost(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, stop_cost: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Set the absolute objective threshold to consider the problem “solved”.
- Parameters:
stop_cost (float) – If the total cost \(J\) falls below this value, the optimizer may terminate early.
- Returns:
Self reference for method chaining.
- Return type:
- set_velocity_limit_scaling(self: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder, velocity_limit_scaling: float) rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder#
Scale internal joint velocity limits used by the optimizer.
- Parameters:
velocity_limit_scaling (float) – Scaling factor \(\alpha_v > 0\). The internal velocity limits become \(\alpha_v \cdot v_{\max}\).
- Returns:
Self reference for method chaining.
- Return type:
Notes
This does not change hardware limits; it affects only the optimization’s internal constraints and trajectory shaping.
- class rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandFeedback#
Feedback for an optimal-control command.
- Variables:
total_cost (float) – Total objective value (dimensionless).
cartesian_costs (list[float]) – Per-Cartesian-target costs (dimensionless).
center_of_mass_cost (float) – Center-of-mass cost (dimensionless).
joint_position_costs (list[float]) – Per-joint position costs (dimensionless).
- property cartesian_costs#
Per-target Cartesian costs.
- Returns:
Dimensionless cost values for each Cartesian target.
- Return type:
list[float]
- property center_of_mass_cost#
Center-of-mass cost.
- Returns:
Dimensionless COM cost.
- Return type:
float
- property joint_position_costs#
Per-joint position costs.
- Returns:
Dimensionless cost values for joint position terms.
- Return type:
list[float]
- property total_cost#
Total objective value.
- Returns:
Dimensionless cost value.
- Return type:
float
- class rb_sdk.rb_sdk_cpp.rby1.PIDGain#
PID gain configuration.
Represents proportional, integral, and derivative gains for PID control.
- Variables:
p_gain (int) – Proportional gain value.
i_gain (int) – Integral gain value.
d_gain (int) – Derivative gain value.
- property d_gain#
- property i_gain#
- property p_gain#
- class rb_sdk.rb_sdk_cpp.rby1.PowerInfo#
Power information
Information about robot-controlled external (auxiliary) power outputs.
- Variables:
name (str) – Name/label of an externally controllable power output (e.g., “5v”, “12v”, “24v”).
- property name#
- class rb_sdk.rb_sdk_cpp.rby1.PowerState#
Power state information.
Provides information about power supply status and voltage.
- Variables:
state (State) – Current power state.
voltage (float) – Power supply voltage in volts.
- class State#
Power state enumeration.
Defines the possible power states.
Members#
- Unknownint
Power state is unknown.
- PowerOffint
Power is off.
- PowerOnint
Power is on.
Members:
Unknown
PowerOff
PowerOn
- PowerOff = <State.PowerOff: 2>#
- PowerOn = <State.PowerOn: 1>#
- Unknown = <State.Unknown: 0>#
- PowerState.State.name -> str
- property value#
- property state#
- property voltage#
- class rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder#
Robot command builder.
Top-level builder that aggregates all types of commands into a single robot command. It can wrap a WholeBodyCommandBuilder, ComponentBasedCommandBuilder, or JogCommandBuilder, and is the final object passed to
robot.send_command(...).Notes
Typically, you do not build this manually for each subsystem. Instead, construct subsystem builders (e.g., ComponentBasedCommandBuilder with body/head/mobility commands) and wrap them in RobotCommandBuilder.
Jog commands can also be wrapped directly for lightweight incremental motions.
Implicit casting is supported, so passing compatible builders automatically creates the appropriate wrapper.
Examples
>>> import numpy as np, rby1_sdk as rby >>> # Example 1: Full stop >>> stop = rby.StopCommandBuilder() >>> whole = rby.WholeBodyCommandBuilder().set_command(stop) >>> rc = rby.RobotCommandBuilder().set_command(whole) >>> # robot.send_command(rc, priority=0).get() >>> >>> # Example 2: Move right arm with a joint position command >>> jp = rby.JointPositionCommandBuilder().set_position(np.zeros(7)) >>> body = rby.BodyComponentBasedCommandBuilder().set_right_arm_command(jp) >>> comp = rby.ComponentBasedCommandBuilder().set_body_command(body) >>> rc = rby.RobotCommandBuilder().set_command(comp) >>> # robot.send_command(rc, priority=1).get() >>> >>> # Example 3: Send a jog command >>> jog = rby.JogCommandBuilder().set_joint_name("right_arm_0") \ ... .set_command(rby.JogCommandBuilder.RelativePosition(0.1)) >>> rc = rby.RobotCommandBuilder().set_command(jog) >>> # robot.send_command(rc, priority=1).get()
- set_command(*args, **kwargs)#
Overloaded function.
set_command(self: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, whole_body_command_builder: rb_sdk.rb_sdk_cpp.rby1.WholeBodyCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder
Assign a whole-body command.
- Parameters:
whole_body_command_builder (WholeBodyCommandBuilder) – Command to apply to the entire robot.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, component_based_command_builder: rb_sdk.rb_sdk_cpp.rby1.ComponentBasedCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder
Assign a component-based command.
- Parameters:
component_based_command_builder (ComponentBasedCommandBuilder) – Command to apply to subsystems (mobility, body, head).
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, jog_command_builder: rb_sdk.rb_sdk_cpp.rby1.JogCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder
Assign a jog command.
- Parameters:
jog_command_builder (JogCommandBuilder) – Jog command for single-joint incremental motion.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Top-level feedback for a robot command.
- Variables:
whole_body_command (WholeBodyCommandFeedback) – Feedback for a whole-body command (if present).
component_based_command (ComponentBasedCommandFeedback) – Feedback for a component-based command (if present).
jog_command (JogCommandFeedback) – Feedback for a jog command (if present).
status (RobotCommandFeedback.Status) – High-level status of the command execution.
finish_code (RobotCommandFeedback.FinishCode) – Finish code indicating why execution finished (if finished).
- class FinishCode#
Reason for finishing (if any).
Members#
- Unknownint
Unknown reason.
- Okint
Finished successfully.
- Canceledint
Canceled by user/system.
- Preemptedint
Preempted by another command.
- InitializationFailedint
Failed during initialization.
- ControlManagerIdleint
Control manager entered idle unexpectedly.
- ControlManagerFaultint
Control manager reported a fault.
- UnexpectedStateint
Reached an unexpected state.
Members:
Unknown
Ok
Canceled
Preempted
InitializationFailed
ControlManagerIdle
ControlManagerFault
UnexpectedState
- Canceled = <FinishCode.Canceled: 2>#
- ControlManagerFault = <FinishCode.ControlManagerFault: 6>#
- ControlManagerIdle = <FinishCode.ControlManagerIdle: 5>#
- InitializationFailed = <FinishCode.InitializationFailed: 4>#
- Ok = <FinishCode.Ok: 1>#
- Preempted = <FinishCode.Preempted: 3>#
- UnexpectedState = <FinishCode.UnexpectedState: 7>#
- Unknown = <FinishCode.Unknown: 0>#
- RobotCommandFeedback.FinishCode.name -> str
- property value#
- class Status#
High-level execution status.
Members#
- Idleint
No command is active.
- Initializingint
Command is initializing.
- Runningint
Command is running.
- Finishedint
Command has finished.
Members:
Idle
Initializing
Running
Finished
- Finished = <Status.Finished: 3>#
- Idle = <Status.Idle: 0>#
- Initializing = <Status.Initializing: 1>#
- Running = <Status.Running: 2>#
- RobotCommandFeedback.Status.name -> str
- property value#
- property component_based_command#
Component-based command feedback.
- Returns:
Feedback object (if present).
- Return type:
- property finish_code#
Finish reason (if finished).
- Returns:
- Return type:
- property jog_command#
Jog command feedback.
- Returns:
Feedback object (if present).
- Return type:
- property status#
High-level execution status.
- Returns:
- Return type:
- property whole_body_command#
Whole-body command feedback.
- Returns:
Feedback object (if present).
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.RobotInfo#
Robot information and configuration.
This class provides comprehensive information about the robot including version details, hardware configuration, and joint specifications.
- Variables:
version (str) – Robot software version.
sdk_version (str) – SDK version.
robot_version (str) – Robot version (deprecated, use robot_model_name instead).
robot_model_name (str) – Name of the robot model.
robot_model_version (str) – Version of the robot model.
sdk_commit_id (str) – SDK commit identifier (deprecated, use sdk_version instead).
battery_info (BatteryInfo) – Battery information.
power_infos (list[PowerInfo]) – Robot-controlled external (auxiliary) power outputs (e.g., “5V”, “12V”, “24V”).
emo_infos (list[EMOInfo]) – List of emergency stop button information.
degree_of_freedom (int) – Total number of degrees of freedom.
joint_infos (list[JointInfo]) – List of joint information.
mobility_joint_idx (list[int]) – Indices of mobility joints (e.g., wheels).
body_joint_idx (list[int]) – Indices of body joints.
head_joint_idx (list[int]) – Indices of head joints.
torso_joint_idx (list[int]) – Indices of torso joints.
right_arm_joint_idx (list[int]) – Indices of right arm joints.
left_arm_joint_idx (list[int]) – Indices of left arm joints.
- property battery_info#
- property body_joint_idx#
- property degree_of_freedom#
- property emo_infos#
- property head_joint_idx#
- property joint_infos#
- property left_arm_joint_idx#
- property mobility_joint_idx#
- property power_infos#
- property right_arm_joint_idx#
- property robot_model_name#
- property robot_model_version#
- property robot_version#
- property sdk_commit_id#
- property sdk_version#
- property torso_joint_idx#
- property version#
- class rb_sdk.rb_sdk_cpp.rby1.RobotState_A#
Robot state information.
Provides information about the overall state of the robot, including system statistics, battery state, power states, emergency stop button states, joint states, tool flange states, force/torque sensor data, and odometry.
- Variables:
timestamp (datetime.datetime) – Timestamp of the robot state (system clock).
system_stat (SystemStat) – System statistics (CPU, memory, uptimes).
battery_state (BatteryState) – Battery voltage/current/level.
power_states (list of PowerState) – Power supply states for each module.
emo_states (list of EMOState) – Emergency-stop button states for each module.
joint_states (list of JointState) – Per-joint status and measurements.
tool_flange_right (ToolFlangeState) – Tool flange sensor and IO state for the right arm.
tool_flange_left (ToolFlangeState) – Tool flange sensor and IO state for the left arm.
ft_sensor_right (FTSensorData) – Force/torque readings on the right arm.
ft_sensor_left (FTSensorData) – Force/torque readings on the left arm.
is_ready (numpy.ndarray of bool, shape (DOF,)) – Whether each joint is ready.
position (numpy.ndarray, shape (DOF,)) – Joint positions [rad].
velocity (numpy.ndarray, shape (DOF,)) – Joint velocities [rad/s].
current (numpy.ndarray, shape (DOF,)) – Joint currents [A].
torque (numpy.ndarray, shape (DOF,)) – Joint torques in Nm.
target_position (numpy.ndarray, shape (DOF,)) – Target joint positions [rad].
target_velocity (numpy.ndarray, shape (DOF,)) – Target joint velocities [rad/s].
target_feedback_gain (numpy.ndarray, shape (DOF,)) – Target feedback gains per joint. Range is [0, 10].
target_feedforward_torque (numpy.ndarray, shape (DOF,)) – Target feedforward torques per joint in Nm.
odometry (numpy.ndarray, shape (3, 3)) – Base pose as a 2D homogeneous transform (SE(2)): rotation (R) and translation (t).
center_of_mass (numpy.ndarray, shape (3,)) – Center of mass position in base frame in meters.
collisions (list of CollisionResult) – Detected collisions or nearest link pairs (links, closest points, signed distance).
temperature (numpy.ndarray, shape (DOF,)) – Joint temperatures in degrees Celsius.
gravity (numpy.ndarray, shape (DOF,)) – Gravity compensation torques per joint in Nm.
Notes
Unless noted otherwise, joint-wise vectors are NumPy arrays with shape
(DOF,), whereDOF = robot.model().robot_dof.odometryuses a 2D homogeneous transform (SE(2)).signed distanceis negative when penetrating.- property battery_state#
- property center_of_mass#
- property collisions#
- property current#
- property emo_states#
- property ft_sensor_left#
- property ft_sensor_right#
- property gravity#
- property is_ready#
- property joint_states#
- property odometry#
- property position#
- property power_states#
- property system_stat#
- property target_feedback_gain#
- property target_feedforward_torque#
- property target_position#
- property target_velocity#
- property temperature#
- property timestamp#
- property tool_flange_left#
- property tool_flange_right#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.RobotState_M#
Robot state information.
Provides information about the overall state of the robot, including system statistics, battery state, power states, emergency stop button states, joint states, tool flange states, force/torque sensor data, and odometry.
- Variables:
timestamp (datetime.datetime) – Timestamp of the robot state (system clock).
system_stat (SystemStat) – System statistics (CPU, memory, uptimes).
battery_state (BatteryState) – Battery voltage/current/level.
power_states (list of PowerState) – Power supply states for each module.
emo_states (list of EMOState) – Emergency-stop button states for each module.
joint_states (list of JointState) – Per-joint status and measurements.
tool_flange_right (ToolFlangeState) – Tool flange sensor and IO state for the right arm.
tool_flange_left (ToolFlangeState) – Tool flange sensor and IO state for the left arm.
ft_sensor_right (FTSensorData) – Force/torque readings on the right arm.
ft_sensor_left (FTSensorData) – Force/torque readings on the left arm.
is_ready (numpy.ndarray of bool, shape (DOF,)) – Whether each joint is ready.
position (numpy.ndarray, shape (DOF,)) – Joint positions [rad].
velocity (numpy.ndarray, shape (DOF,)) – Joint velocities [rad/s].
current (numpy.ndarray, shape (DOF,)) – Joint currents [A].
torque (numpy.ndarray, shape (DOF,)) – Joint torques in Nm.
target_position (numpy.ndarray, shape (DOF,)) – Target joint positions [rad].
target_velocity (numpy.ndarray, shape (DOF,)) – Target joint velocities [rad/s].
target_feedback_gain (numpy.ndarray, shape (DOF,)) – Target feedback gains per joint. Range is [0, 10].
target_feedforward_torque (numpy.ndarray, shape (DOF,)) – Target feedforward torques per joint in Nm.
odometry (numpy.ndarray, shape (3, 3)) – Base pose as a 2D homogeneous transform (SE(2)): rotation (R) and translation (t).
center_of_mass (numpy.ndarray, shape (3,)) – Center of mass position in base frame in meters.
collisions (list of CollisionResult) – Detected collisions or nearest link pairs (links, closest points, signed distance).
temperature (numpy.ndarray, shape (DOF,)) – Joint temperatures in degrees Celsius.
gravity (numpy.ndarray, shape (DOF,)) – Gravity compensation torques per joint in Nm.
Notes
Unless noted otherwise, joint-wise vectors are NumPy arrays with shape
(DOF,), whereDOF = robot.model().robot_dof.odometryuses a 2D homogeneous transform (SE(2)).signed distanceis negative when penetrating.- property battery_state#
- property center_of_mass#
- property collisions#
- property current#
- property emo_states#
- property ft_sensor_left#
- property ft_sensor_right#
- property gravity#
- property is_ready#
- property joint_states#
- property odometry#
- property position#
- property power_states#
- property system_stat#
- property target_feedback_gain#
- property target_feedforward_torque#
- property target_position#
- property target_velocity#
- property temperature#
- property timestamp#
- property tool_flange_left#
- property tool_flange_right#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.RobotState_UB#
Robot state information.
Provides information about the overall state of the robot, including system statistics, battery state, power states, emergency stop button states, joint states, tool flange states, force/torque sensor data, and odometry.
- Variables:
timestamp (datetime.datetime) – Timestamp of the robot state (system clock).
system_stat (SystemStat) – System statistics (CPU, memory, uptimes).
battery_state (BatteryState) – Battery voltage/current/level.
power_states (list of PowerState) – Power supply states for each module.
emo_states (list of EMOState) – Emergency-stop button states for each module.
joint_states (list of JointState) – Per-joint status and measurements.
tool_flange_right (ToolFlangeState) – Tool flange sensor and IO state for the right arm.
tool_flange_left (ToolFlangeState) – Tool flange sensor and IO state for the left arm.
ft_sensor_right (FTSensorData) – Force/torque readings on the right arm.
ft_sensor_left (FTSensorData) – Force/torque readings on the left arm.
is_ready (numpy.ndarray of bool, shape (DOF,)) – Whether each joint is ready.
position (numpy.ndarray, shape (DOF,)) – Joint positions [rad].
velocity (numpy.ndarray, shape (DOF,)) – Joint velocities [rad/s].
current (numpy.ndarray, shape (DOF,)) – Joint currents [A].
torque (numpy.ndarray, shape (DOF,)) – Joint torques in Nm.
target_position (numpy.ndarray, shape (DOF,)) – Target joint positions [rad].
target_velocity (numpy.ndarray, shape (DOF,)) – Target joint velocities [rad/s].
target_feedback_gain (numpy.ndarray, shape (DOF,)) – Target feedback gains per joint. Range is [0, 10].
target_feedforward_torque (numpy.ndarray, shape (DOF,)) – Target feedforward torques per joint in Nm.
odometry (numpy.ndarray, shape (3, 3)) – Base pose as a 2D homogeneous transform (SE(2)): rotation (R) and translation (t).
center_of_mass (numpy.ndarray, shape (3,)) – Center of mass position in base frame in meters.
collisions (list of CollisionResult) – Detected collisions or nearest link pairs (links, closest points, signed distance).
temperature (numpy.ndarray, shape (DOF,)) – Joint temperatures in degrees Celsius.
gravity (numpy.ndarray, shape (DOF,)) – Gravity compensation torques per joint in Nm.
Notes
Unless noted otherwise, joint-wise vectors are NumPy arrays with shape
(DOF,), whereDOF = robot.model().robot_dof.odometryuses a 2D homogeneous transform (SE(2)).signed distanceis negative when penetrating.- property battery_state#
- property center_of_mass#
- property collisions#
- property current#
- property emo_states#
- property ft_sensor_left#
- property ft_sensor_right#
- property gravity#
- property is_ready#
- property joint_states#
- property odometry#
- property position#
- property power_states#
- property system_stat#
- property target_feedback_gain#
- property target_feedforward_torque#
- property target_position#
- property target_velocity#
- property temperature#
- property timestamp#
- property tool_flange_left#
- property tool_flange_right#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.Robot_A#
Robot (model:
Model_A) control interface.Provides high-level control interface for robot operations including connection management, power control, and command execution.
- Variables:
model (Model_A) – Robot model configuration.
- brake_engage(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Engage the brake for a device.
- Parameters:
dev_name (str) – Device name (joint name) to engage brake. Supports regex patterns.
Examples
>>> # Engage brake for maintenance >>> robot.brake_engage("right_arm_0")
- brake_release(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
break_release(dev_name)
Release the brake for a device.
- Parameters:
dev_name (str) – Device name (joint name) to release brake. Supports regex patterns.
Examples
>>> # Release brake to allow movement >>> robot.brake_release("right_arm_0")
- cancel_control(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Cancel current control operation.
- connect(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, max_retries: int = 5, timeout_ms: int = 1000) bool#
Attempts to establish a connection with the robot.
- Parameters:
max_retries (int, optional) – Maximum number of retries to connect. Default is 5.
timeout_ms (int, optional) – Timeout in milliseconds for each connection attempt. Default is 1000.
- Returns:
Trueif the connection was successful,Falseotherwise.- Return type:
bool
Examples
>>> robot = rby1_sdk.create_robot("192.168.1.100", "a") >>> if robot.connect(): ... print("Connected to robot") ... else: ... print("Failed to connect") >>> # Default: max_retries=5, timeout_ms=1000 >>> # Custom: robot.connect(max_retries=10, timeout_ms=2000)
- connect_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, ssid: str, password: str = '', use_dhcp: bool = True, ip_address: str = '', gateway: str = '', dns: list[str] = []) bool#
Connect to WiFi network.
- Parameters:
ssid (str) – WiFi network name.
password (str, optional) – WiFi password. Default is empty string.
use_dhcp (bool, optional) – Use DHCP. Default is True.
ip_address (str, optional) – Static IP address. Default is empty string.
gateway (str, optional) – Gateway address. Default is empty string.
dns (list[str], optional) – DNS servers. Default is empty string.
Examples
>>> # Connect using DHCP (automatic IP) >>> robot.connect_wifi("MyWiFi", "mypassword123") >>> # Connect with static IP configuration >>> robot.connect_wifi("MyWiFi", "mypassword123", use_dhcp=False, ... ip_address="192.168.1.100/24", gateway="192.168.1.1") >>> # Connect to open network >>> robot.connect_wifi("OpenNetwork") >>> # Check connection status >>> status = robot.get_wifi_status() >>> print(f"Connected: {status.connected}, SSID: {status.ssid}")
- control(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, control: Callable[[rb_sdk.rb_sdk_cpp.rby1.Robot_A_ControlState], rb_sdk.rb_sdk_cpp.rby1.Robot_A_ControlInput], port: int = 0, priority: int = 1) bool#
Start a blocking real-time control loop using a custom control callback.
This function runs a UDP-based real-time loop that repeatedly calls the user-provided
control(ControlState) -> ControlInput. The loop exits when the callback returns aControlInputwithfinish=True, or when an error/abort occurs. The function returnsTrueonly if it finished viafinish=True; otherwiseFalse.- Parameters:
control (callable) – A callable that accepts a
ControlStateand returns aControlInput. The callback is invoked for each received RT state packet.port (int, optional) – UDP port to bind for the RT server. Use
0to let the OS choose an available port (recommended). Default is0.priority (int, optional) – Command priority sent with the RT control request. Default is
1.
- Returns:
Trueif the loop terminated because the callback setfinish=TrueinControlInput.Falseif the loop ended due to an error or abort (e.g., UDP bind failure, connection issue).- Return type:
bool
Notes
Blocking: This call blocks until the control loop ends. There is no handler for external cancellation. Design the callback to set
finish=Truewhen you want to stop.GIL behavior: The function releases the Python GIL around I/O and reacquires it only when invoking your Python callback, allowing other Python threads to run between callbacks.
Performance: Keep the callback lightweight—avoid long computations or blocking I/O inside the callback to maintain RT responsiveness.
State fields: The provided
ControlStateincludes timestampt, and arrays such asposition,velocity,current, andtorquefor all DoFs of the robot.Errors: If the UDP server fails to bind (e.g., port unavailable), the function returns
Falseimmediately (and prints the error tostderr).
Examples
>>> import numpy as np >>> >>> # Stop after ~2 seconds using state.t >>> t0 = {"t": None} >>> def control_fn(state): ... if t0["t"] is None: ... t0["t"] = state.t ... finish = (state.t - t0["t"]) >= 2.0 ... i = ControlInput() ... i.mode.fill(rby.ControlMode.Position) ... i.target = np.zeros_like(state.position) # hold home ... i.feedback_gain.fill(10) # simple P gain ... i.feedforward_torque.fill(0) # no torque feedforward ... i.finish = finish ... return i >>> ok = robot.control(control_fn) >>> print(ok) # True if finished via finish=True
- static create(address: str) rb_sdk.rb_sdk_cpp.rby1.Robot_A#
Create a robot instance.
- Parameters:
address (str) – Robot network address, e.g. “192.168.1.100:50051”.
- Returns:
Robot instance.
- Return type:
Robot
Examples
>>> import rby1_sdk >>> robot = rby.Robot_A.create("192.168.30.1:50051") >>> robot.connect() >>> if robot.is_connected(): ... print("Robot connected successfully") ... robot_info = robot.get_robot_info() ... print(f"Robot model: {robot.model().model_name}") ... # Note: Model A has mobile base (2-DOF) + torso (6-DOF) + right arm (7-DOF) + left arm (7-DOF) + head (2-DOF) ... # Total joints: 2 + 6 + 7 + 7 + 2 = 24 DOF for model A
- create_command_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, priority: int = 1) rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler#
Create a command stream for continuous command sending.
- Parameters:
priority (int, optional) – Command priority. Default is 1.
- Returns:
Command stream handler.
- Return type:
RobotCommandStreamHandler
Examples
>>> # Create command stream for continuous operation >>> stream_handler = robot.create_command_stream(priority=1) >>> # Send commands continuously >>> for i in range(10): ... command_builder = create_command(i) ... stream_handler.send_command(command_builder, timeout_ms=1000) ... time.sleep(1) >>> # Through the handler, you can terminate control or check the current state >>> stream_handler.cancel() >>> # See examples/python/cartesian_command_stream.py for complete usage
- disable_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Disable the control manager.
- disconnect(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) None#
Disconnects from the robot.
- disconnect_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Disconnect from WiFi network.
- download_file(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, path: str, file_like: object) bool#
Downloads a file from the robot and writes it into a file-like object.
- Parameters:
path (str) – Relative path to the file on the robot’s file system. The base directory is defined by the RBY1_HOME environment variable (default: /root/.rby1).
file_like (file-like object) – Any object with a .write(bytes) method (e.g., io.BytesIO, a real file).
- Returns:
Trueif the file was downloaded successfully.- Return type:
bool
- Raises:
RuntimeError – If the gRPC call fails (e.g., network issue, file not found, internal error).
- enable_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, unlimited_mode_enabled: bool = False) bool#
Enable the control manager.
- Parameters:
unlimited_mode_enabled (bool, optional) – Whether to enable unlimited mode. Default is False.
Examples
>>> # Enable control manager for robot control >>> robot.enable_control_manager() >>> # Enable with unlimited mode (use with caution) >>> robot.enable_control_manager(unlimited_mode_enabled=True) >>> # Must be called before sending commands
- factory_reset_all_parameters(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) None#
Factory reset all parameters to their default values.
- factory_reset_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str) bool#
Factory reset a parameter to its default value.
- Parameters:
name (str) – Parameter name.
- get_control_manager_state(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) rb_sdk.rb_sdk_cpp.rby1.ControlManagerState#
Get control manager state.
- Returns:
Current control manager state.
- Return type:
Examples
>>> # Get control manager state >>> ctrl_state = robot.get_control_manager_state() >>> print(f"Control Manager state: {ctrl_state.state}") >>> print(f"Control state: {ctrl_state.control_state}") >>> # Check if control manager is enabled >>> if ctrl_state.state == rby1_sdk.ControlManagerState.State.Enabled: ... print("Control manager is enabled")
- get_dynamics(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, urdf_model: str = '') rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_24#
Get robot dynamics model.
- Parameters:
urdf_model (str, optional) – URDF model path. Default is empty string.
- Returns:
Robot dynamics model.
- Return type:
dyn.Robot
Examples
>>> # Get dynamics model with the model from connected robot >>> dynamics_robot = robot.get_dynamics() >>> # Get dynamics model with custom URDF >>> dynamics_robot = robot.get_dynamics("/path/to/custom.urdf") >>> # Useful for advanced control algorithms
- get_fault_log_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[str]#
Get fault log list.
- Returns:
List of fault log entries.
- Return type:
list
- get_head_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get head position PID gains.
- Returns:
Head position PID gains.
- Return type:
- get_last_log(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, count: int) list[rb_sdk.rb_sdk_cpp.rby1.Log]#
Get last log entries.
- Parameters:
count (int) – Number of log entries to retrieve.
- Returns:
List of log entries.
- Return type:
list
- get_left_arm_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get left arm position PID gains.
- Returns:
Left arm position PID gains.
- Return type:
- get_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str) str#
Retrieve a robot parameter.
- Parameters:
name (str) – Name of the parameter to retrieve.
- Returns:
Parameter value. Returned as a JSON value: numeric values are returned as-is, strings are enclosed in quotes (”…”).
- Return type:
any
Examples
>>> # Retrieve current parameter values >>> acc_scaling = robot.get_parameter("default.acceleration_limit_scaling") >>> cutoff_freq = robot.get_parameter("joint_position_command.cutoff_frequency") >>> model_name = robot.get_parameter("robot_model_name") >>> print(f"Acceleration scaling: {acc_scaling}") >>> print(f"Cutoff frequency: {cutoff_freq}") >>> print(f"Model name: {model_name}")
- get_parameter_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[tuple[str, int]]#
Get list of available parameters.
- Returns:
List of parameter names.
- Return type:
list
Examples
>>> # Get all available parameters >>> param_list = robot.get_parameter_list() >>> print(f"Total parameters: {len(param_list)}") >>> # List common parameter categories >>> for param in param_list: ... if param[0].startswith("default."): ... print(f"Default param: {param}") ... elif param[0].startswith("joint_position_command."): ... print(f"Joint position param: {param}") >>> # Common categories: default.*, joint_position_command.*, cartesian_command.*
- get_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) rb_sdk.rb_sdk_cpp.rby1.PIDGain#
Get position PID gains for a device.
- Parameters:
dev_name (str) – Device name.
- Returns:
Position PID gains for the device.
- Return type:
Examples
>>> # Get PID gains for specific device >>> torso_pid = robot.get_position_pid_gain("torso_5") >>> print(f"Torso 5 P: {torso_pid.p_gain}, I: {torso_pid.i_gain}, D: {torso_pid.d_gain}") >>> # Get PID gains for arm >>> arm_pid = robot.get_position_pid_gain("right_arm_0") >>> print(f"Right arm 0 P: {arm_pid.p_gain}") >>> devices = ["torso_5", "right_arm_0", "left_arm_1", "head_0"] >>> for device in devices: ... pid = robot.get_position_pid_gain(device) ... print(f"{device}: P={pid.p_gain}, I={pid.i_gain}, D={pid.d_gain}")
- get_right_arm_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get right arm position PID gains.
- Returns:
Right arm position PID gains.
- Return type:
- get_robot_info(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) rb_sdk.rb_sdk_cpp.rby1.RobotInfo#
Retrieves static information about the robot, such as model name, SDK version, and joint configuration.
- Returns:
Structured metadata including joint details, device names, and robot model information.
- Return type:
Examples
>>> # Get robot information >>> robot_info = robot.get_robot_info() >>> print(f"SDK version: {robot_info.sdk_version}") >>> print(f"Robot model name: {robot_info.robot_model_name}") >>> print(f"Robot model version: {robot_info.robot_model_version}") >>> print(f"Joint count: {len(robot_info.joint_infos)}") >>> # Access joint information >>> for joint in robot_info.joint_infos: ... print(f"Joint: {joint.name}, Brake: {joint.has_brake}, Product name: {joint.product_name}, Firmware version: {joint.firmware_version}")
- get_robot_model(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) str#
Get the current robot URDF model.
- Returns:
Current robot model.
- Return type:
RobotModel
- get_serial_device_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[rb_sdk.rb_sdk_cpp.rby1.SerialDevice]#
Get list of available serial devices on the robot.
- Returns:
List of available serial devices.
- Return type:
list
Examples
>>> # Get available serial devices >>> devices = robot.get_serial_device_list() >>> print(f"Found {len(devices)} serial devices") >>> # List device information >>> for device in devices: ... print(f"Path: {device.path}, Description: {device.description}") >>> # Open serial stream to first device >>> if devices: ... stream = robot.open_serial_stream(devices[0].path, 115200) >>> # Common device paths: /dev/ttyUSB0, /dev/ttyACM0, COM1, COM2
- get_state(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) rb_sdk.rb_sdk_cpp.rby1.RobotState_A#
Get current robot state.
- Returns:
Current robot state.
- Return type:
RobotState
Examples
>>> robot_state = robot.get_state() >>> model = robot.model() >>> print(f"Joint positions: {robot_state.position}") >>> print(f"Right arm position: {robot_state.position[model.right_arm_idx]}") >>> # Note: Joint positions include mobile base (2-DOF) + torso (6-DOF) + right arm (7-DOF) + left arm (7-DOF) + head (2-DOF) >>> # Total: 24 DOF for model A, 23 DOF for model M, 26 DOF for model M, 18 DOF for model UB
- get_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) tuple[object, str]#
Get robot system time.
- Returns:
(datetime, str): Robot system time and local time string.
- Return type:
tuple
- get_time_scale(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) float#
Get the current time scale.
- Returns:
Current time scale value.
- Return type:
float
Examples
>>> # Get current time scale >>> current_scale = robot.get_time_scale() >>> print(f"Current time scale: {current_scale}") >>> # Check if robot is running at full speed >>> if current_scale == 1.0: ... print("Robot running at full speed") >>> # Check if robot is slowed down >>> elif current_scale < 1.0: ... print(f"Robot running at {current_scale * 100}% speed")
- get_torso_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get torso position PID gains.
- Returns:
Torso position PID gains.
- Return type:
Examples
>>> # Get current PID gains for torso >>> torso_pid = robot.get_torso_position_pid_gains()[0] # Get first (and only) torso device >>> print(f"Torso P: {torso_pid.p_gain}, I: {torso_pid.i_gain}, D: {torso_pid.d_gain}") >>> right_arm_pid = robot.get_right_arm_position_pid_gains()[0] >>> print(f"Right arm: {right_arm_pid}")
- get_wifi_status(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) rb_sdk.rb_sdk_cpp.rby1.WifiStatus | None#
Get WiFi connection status.
- Returns:
Current WiFi status.
- Return type:
- has_established_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Check if time synchronization is established.
- Returns:
True if time sync is established, False otherwise.
- Return type:
bool
- home_offset_reset(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Reset home offset for a device.
- Parameters:
dev_name (str) – Device name to reset home offset. Supports regex patterns.
- import_robot_model(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str, model: str) bool#
Import a robot model.
- Parameters:
name (str) – Model name.
model (RobotModel) – Robot model to import.
- is_connected(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Checks whether the robot is currently connected.
- Returns:
Trueif the robot is connected to the robot,Falseotherwise.- Return type:
bool
- is_power_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Check if a device is powered on.
- Parameters:
dev_name (str) – Device name to check. Supports regex patterns.
- Returns:
Trueif device is powered on,Falseotherwise.- Return type:
bool
- is_servo_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Check if servo control is enabled for a device.
- Parameters:
dev_name (str) – Device name to check. Supports regex patterns.
- Returns:
Trueif servo control is enabled,Falseotherwise.- Return type:
bool
- static model() rb_sdk.rb_sdk_cpp.rby1.Model_A#
Get the robot model configuration.
- Returns:
Robot model configuration object.
- Return type:
- open_serial_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, device_path: str, baudrate: int, bytesize: int = 8, parity: str = 'N', stopbits: int = 1) rb_sdk.rb_sdk_cpp.rby1.SerialStream#
Open a serial stream.
- Parameters:
device_path (str) – Path to serial device.
baudrate (int) – Baud rate.
bytesize (int, optional) – Data bits. Default is 8.
parity (str, optional) – Parity setting. Default is ‘N’.
stopbits (int, optional) – Stop bits. Default is 1.
- Returns:
Serial stream object.
- Return type:
Examples
>>> # Open serial stream with default settings >>> stream = robot.open_serial_stream("/dev/ttyUSB0", 115200) >>> # Open with custom settings >>> stream = robot.open_serial_stream("/dev/ttyUSB1", 9600, bytesize=7, parity='E', stopbits=2) >>> # Common baudrates: 9600, 19200, 38400, 57600, 115200 >>> # Parity: 'N' (none), 'E' (even), 'O' (odd) >>> # Stop bits: 1, 2
- power_off(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Power off a device.
- Parameters:
dev_name (str) – Device name to power off. Supports regex patterns.
- power_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Power on a device.
- Parameters:
dev_name (str) – Device name to power on. Supports regex patterns.
Examples
>>> robot.connect() >>> if not robot.is_power_on(".*"): ... robot.power_on(".*") ... print("Robot powered on") >>> # Pattern ".*" powers on all devices >>> # Specific device: robot.power_on("12v"), robot.power_on("24v"), etc.
- reset_all_parameters(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) None#
Reset all parameters to their current values.
- reset_all_parameters_to_default(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) None#
Reset all parameters to their default values (deprecated).
Deprecated since version 0.6.0: Use
factory_reset_all_parameters()instead.Note
This method is deprecated. Use factory_reset_all_parameters() instead.
- reset_battery_config(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Reset battery configuration to default.
- reset_fault_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Reset fault in the control manager.
- reset_network_setting(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Reset network settings to default.
- reset_odometry(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, angle: float, position: numpy.ndarray[numpy.float64[2, 1]]) bool#
reset_odometry(angle, position)
Reset odometry to specified values.
- Parameters:
angle (float) – New angle [rad].
position (numpy.ndarray) – New position [m].
Examples
>>> import numpy as np >>> # Reset odometry to origin >>> robot.reset_odometry(angle=0.0, position=np.array([0.0, 0.0])) >>> # Reset to specific position and orientation >>> robot.reset_odometry(angle=np.pi/2, position=np.array([1.0, 2.0])) >>> # Useful for mobile base navigation >>> # Position is [x, y] in meters, angle is yaw in rad
- reset_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str) bool#
Reset a parameter to its current value.
- Parameters:
name (str) – Parameter name.
- reset_parameter_to_default(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str) bool#
Reset a parameter to its default value (deprecated).
- Parameters:
name (str) – Parameter name.
deprecated: (..) – 0.6.0: Use
factory_reset_parameter()instead.
Note
This method is deprecated. Use factory_reset_parameter() instead.
- scan_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) list[rb_sdk.rb_sdk_cpp.rby1.WifiNetwork]#
Scan for available WiFi networks.
- Returns:
List of available WiFi networks.
- Return type:
list
Examples
>>> # Scan for available WiFi networks >>> networks = robot.scan_wifi() >>> print(f"Found {len(networks)} networks") >>> # List network information >>> for network in networks: ... print(f"SSID: {network.ssid}, Signal: {network.signal_strength}") >>> # Connect to a network >>> if networks: ... robot.connect_wifi(networks[0].ssid, "password")
- send_command(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, builder: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, priority: int = 1) rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler#
Send a command to the robot.
- Parameters:
builder (CommandBuilder) – Command builder to send.
priority (int, optional) – Command priority. Default is 1.
- Returns:
Command handler for monitoring execution.
- Return type:
RobotCommandHandler
Examples
>>> from rby1_sdk import RobotCommandBuilder, ComponentBasedCommandBuilder >>> from rby1_sdk import BodyComponentBasedCommandBuilder, JointPositionCommandBuilder >>> # Create command with method chaining (standard pattern) >>> command = RobotCommandBuilder().set_command( ... ComponentBasedCommandBuilder().set_body_command( ... BodyComponentBasedCommandBuilder() ... .set_torso_command( ... JointPositionCommandBuilder() ... .set_position([0, 0, 0, 0, 0, 0]) # 6-DOF torso ... .set_minimum_time(2.0) ... ) ... ) ... ) >>> handler = robot.send_command(command) >>> handler.wait() # Wait for completion >>> # This pattern is used in most examples: examples/python/07_impedance_control.py, 09_demo_motion.py, etc.
- servo_off(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Disable servo control for a device.
- Parameters:
dev_name (str) – Device name to disable servo control. Supports regex patterns.
Examples
>>> # Disable servo control for safety >>> robot.servo_off(".*") # All motor drivers >>> # Specific device: robot.servo_off("^torso_.*")
- servo_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str) bool#
Enable servo control for a device.
- Parameters:
dev_name (str) – Device name to enable servo control. Supports regex patterns.
Examples
>>> robot.connect() >>> if not robot.is_servo_on(".*"): ... robot.servo_on(".*") # Servo on all devices ... print("All devices servoed on") >>> # Specific device: robot.servo_on("^torso_.*"), robot.servo_on("^right_arm_.*"), etc.
- set_battery_config(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, cutoff_voltage: float, fully_charged_voltage: float, coefficients: Annotated[list[float], FixedSize(4)]) bool#
Set battery configuration.
- set_battery_level(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, arg0: float) bool#
Set battery level.
- Parameters:
level (float) – Battery level percentage (0.0 to 100.0).
Examples
>>> # Set battery level for testing >>> robot.set_battery_level(100.0) # Full battery >>> robot.set_battery_level(50.0) # Half battery >>> robot.set_battery_level(25.0) # Quarter battery >>> robot.set_battery_level(0.0) # Empty battery >>> # Range: 0.0 to 100.0 >>> # Useful for using custom battery
- set_led_color(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, color: rb_sdk.rb_sdk_cpp.rby1.Color, duration: float = 1, transition_time: float = 0, blinking: bool = False, blinking_freq: float = 1) bool#
Set LED color.
- Parameters:
color (Color) – LED color.
duration (float, optional) – Duration in seconds. Default is 1.
transition_time (float, optional) – Transition time in seconds. Default is 0.
blinking (bool, optional) – Whether to blink. Default is False.
blinking_freq (float, optional) – Blinking frequency in Hz. Default is 1.
Examples
>>> from rby1_sdk import Color >>> # Set LED to red for 5 seconds >>> robot.set_led_color(Color(255, 0, 0), duration=5.0) >>> # Set LED to green with 1 second transition >>> robot.set_led_color(Color(0, 255, 0), transition_time=1.0) >>> # Set LED to blue with blinking >>> robot.set_led_color(Color(0, 0, 255), blinking=True, blinking_freq=2.0) >>> # Set LED to white with custom duration and transition >>> robot.set_led_color(Color(255, 255, 255), duration=10.0, transition_time=2.0)
- set_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str, value: str, write_db: bool = True) bool#
Set a robot parameter.
- Parameters:
name (str) – Parameter name.
value (any) – Parameter value.
write_db (bool, optional) – Whether to write to database. Default is True.
Examples
>>> # Set acceleration limit scaling >>> robot.set_parameter("default.acceleration_limit_scaling", "0.8") >>> # Set joint position command cutoff frequency >>> robot.set_parameter("joint_position_command.cutoff_frequency", "5") >>> # Set hotspot SSID name >>> robot.set_parameter("hotspot.ssid", "\"RBY1_HOTSPOT\"") # For str value, use escaped quotes >>> # Set without writing to database (Return ``False`` if matching parameter not found) >>> robot.set_parameter("temp.parameter", "value", write_db=False) False
- set_position_d_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str, d_gain: int) bool#
Set position D gain for a device.
- Parameters:
dev_name (str) – Device name.
d_gain (int) – D gain value.
Examples
>>> # Set D gain for specific devices >>> robot.set_position_d_gain("torso_5", 400)
- set_position_i_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str, i_gain: int) bool#
Set position I gain for a device.
- Parameters:
dev_name (str) – Device name.
i_gain (int) – I gain value.
Examples
>>> # Set I gain for specific devices >>> robot.set_position_i_gain("torso_5", 40)
- set_position_p_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str, p_gain: int) bool#
Set position P gain for a device.
- Parameters:
dev_name (str) – Device name.
p_gain (int) – P gain value.
Examples
>>> # Set P gain for specific devices >>> robot.set_position_p_gain("torso_5", 220)
- set_position_pid_gain(*args, **kwargs)#
Overloaded function.
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str, p_gain: int, i_gain: int, d_gain: int) -> bool
Set position PID gains for a device.
- Parameters:
dev_name (str) – Device name.
p_gain (int) – P gain value.
i_gain (int) – I gain value.
d_gain (int) – D gain value.
- Returns:
True if successful, False otherwise.
- Return type:
bool
Examples
>>> # Set all PID gains at once for a device >>> robot.set_position_pid_gain("right_arm_0", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_1", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_2", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_3", 35, 5, 80) >>> robot.set_position_pid_gain("right_arm_4", 30, 5, 70) >>> robot.set_position_pid_gain("right_arm_5", 30, 5, 70) >>> robot.set_position_pid_gain("right_arm_6", 100, 5, 120)
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, dev_name: str, pid_gain: rb_sdk.rb_sdk_cpp.rby1.PIDGain) -> bool
Set position PID gains for a device using PIDGain object.
- Parameters:
dev_name (str) – Device name.
pid_gain (PIDGain) – PID gain object.
- Returns:
True if successful, False otherwise.
- Return type:
bool
- set_preset_position(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, joint_name: str) bool#
Set preset position for a joint (only available for PVL-based motors).
- Parameters:
joint_name (str) – Joint name to set preset position.
Examples
>>> # Set preset position for specific joints >>> robot.set_preset_position("right_arm_6") # Right arm joint 6 >>> # Preset position is used as reference for home offset
- set_system_time(*args, **kwargs)#
Overloaded function.
set_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, datetime: object) -> bool
Set robot system time.
- Parameters:
datetime (datetime.datetime) – New system time.
set_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, datetime: object, time_zone: str) -> bool
Set robot system time with timezone.
- Parameters:
datetime (datetime.datetime) – New system time.
time_zone (str) – Timezone string.
- set_time_scale(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, time_scale: float) float#
Set the time scale for motion execution.
- Parameters:
time_scale (float) – Time scale value (0.0 to 1.0).
Examples
>>> # Set time scale for motion execution >>> robot.set_time_scale(1.0) # Normal speed (100%) >>> robot.set_time_scale(0.5) # Half speed (50%) >>> robot.set_time_scale(0.25) # Quarter speed (25%) >>> # Range: 0.0 (stopped) to 1.0 (full speed) >>> # Useful for testing and safety
- set_tool_flange_digital_output(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str, channel: int, state: bool) bool#
Set the digital output state of a specific channel on the tool flange of the specified arm.
- Parameters:
name (str) – Arm identifier. Must be either “right” or “left”, indicating the tool flange of the right or left arm.
channel (int) – Digital output channel index.
state (bool) – Desired state of the digital output (
True= ON,False= OFF).
- Returns:
Trueif the command was successfully sent,Falseotherwise.- Return type:
bool
Examples
>>> # Turn on channel 0 on the right arm tool flange >>> robot.set_tool_flange_digital_output("right", 0, True)
- set_tool_flange_digital_output_dual(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str, state_0: bool, state_1: bool) bool#
Set the digital output states of two channels on the tool flange of the specified arm simultaneously.
- Parameters:
name (str) – Arm identifier. Must be either “right” or “left”, indicating the tool flange of the right or left arm.
state_0 (bool) – Desired state for digital output channel 0 (True = ON, False = OFF).
state_1 (bool) – Desired state for digital output channel 1 (True = ON, False = OFF).
- Returns:
Trueif the command was successfully sent,Falseotherwise.- Return type:
bool
Examples
>>> # Turn on channel 0 and turn off channel 1 on the left arm tool flange >>> robot.set_tool_flange_digital_output_dual("left", True, False)
- set_tool_flange_output_voltage(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, name: str, voltage: int) bool#
Set tool flange output voltage.
- Parameters:
name (str) – Tool flange name “right” or “left”.
voltage (int) – Output voltage in volts.
Examples
>>> # Set tool flange output voltage >>> robot.set_tool_flange_output_voltage("right", 12) # 12V output >>> robot.set_tool_flange_output_voltage("left", 24) # 24V output >>> # Common voltages: 12V, 24V >>> # Use 0V to turn off output >>> # Note: This method sets voltage for both tool flanges (right and left)
- start_log_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, cb: Callable[[list[rb_sdk.rb_sdk_cpp.rby1.Log]], None], rate: float) None#
Start log stream callback.
- Parameters:
cb (callable) – Callback function for log updates.
rate (float) – Update rate in Hz.
Examples
>>> def log_callback(log_entries): ... for log in log_entries: ... print(f"{log.timestamp} - {log.level} - {log.message}") >>> # Start log stream at 10 Hz >>> robot.start_log_stream(log_callback, 10.0) >>> # Stop when done: robot.stop_log_stream()
- start_state_update(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, cb: Callable, rate: float) None#
Start state update callback.
- Parameters:
cb (callable) – Callback function with 1 or 2 parameters: - cb(robot_state) or cb(robot_state, control_manager_state)
rate (float) – Update rate in Hz.
Examples
>>> def state_callback(robot_state): ... print(f"Timestamp: {robot_state.timestamp}, Joint positions: {robot_state.position}") >>> # Start state updates at 100 Hz >>> robot.start_state_update(state_callback, 100.0) >>> # Stop when done: robot.stop_state_update()
- start_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, period_sec: int) bool#
Start time synchronization.
- Parameters:
period_sec (float) – Synchronization period in seconds.
- stop_log_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) None#
Stop log stream callback.
- stop_state_update(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) None#
Stop state update callback.
- stop_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Stop time synchronization.
- sync_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A) bool#
Synchronizes the timestamp of
RobotStateto UPC time instead of UTC. Useful when synchronizing multiple devices to UPC time.
- wait_for_control_ready(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A, timeout_ms: int) bool#
Wait until the robot is ready to accept control commands.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif the robot is ready to accept control (you can now set control).Falseif the timeout expired before the robot became ready.- Return type:
bool
Examples
>>> # Wait for control to be ready >>> if robot.wait_for_control_ready(timeout_ms=5000): ... print("Control is ready, you can now set control commands.") ... else: ... print("Timeout: control is not ready.") >>> # Call after servo_on() and before sending control commands
- class rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler#
Robot (model:
Model_A) command handler.Handles robot command execution and provides status monitoring.
- cancel(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler) None#
Cancel the command execution.
- get(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Wait for the command execution and get feedback
- Returns:
Current feedback information.
- Return type:
- get_status(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler) bool#
Get gRPC status
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler) bool#
Check if the command execution is complete.
- Returns:
Trueif command is complete,Falseotherwise.- Return type:
bool
- wait(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler) None#
Wait for the command execution to complete.
This method blocks until the command is done or cancelled.
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandHandler, timeout_ms: int) bool#
Wait for the command execution with timeout.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif command completed,Falseif timeout.- Return type:
bool
- class rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler#
Robot (model:
Model_A) command stream handler.Handles robot command execution through streaming with send and feedback capabilities.
- Variables:
is_done (bool) – Whether the command execution is complete.
- cancel(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler) None#
Cancel the current command execution.
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler) bool#
Check if the command execution is complete.
- Returns:
True if command is complete, False otherwise.
- Return type:
bool
- request_feedback(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Request feedback from the robot.
- Parameters:
timeout_ms (int, optional) – Timeout in milliseconds. Default is 1000.
- Returns:
Current feedback information.
- Return type:
- send_command(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler, builder: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Send a command through the stream.
- Parameters:
builder (CommandBuilder) – Command builder to send.
timeout_ms (int, optional) – Timeout in milliseconds. Default is 1000.
- Returns:
Current feedback information.
- Return type:
- wait(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler) None#
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.Robot_A_CommandStreamHandler, timeout_ms: int) bool#
Wait for the command execution to complete.
This method blocks until the command is done or cancelled.
- class rb_sdk.rb_sdk_cpp.rby1.Robot_A_ControlInput#
Robot (model:
Model_A) control input.Represents control input parameters for robot real-time control including mode, target, and gains.
- Variables:
mode (numpy.ndarray) – Control mode for each joint (boolean array).
target (numpy.ndarray) – Target positions for each joint [rad].
feedback_gain (numpy.ndarray) – Feedback gains for each joint.
feedforward_torque (numpy.ndarray) – Feedforward torque for each joint [Nm].
finish (bool) – Whether to finish the current control operation.
- property feedback_gain#
- property feedforward_torque#
- property finish#
- property mode#
- property target#
- class rb_sdk.rb_sdk_cpp.rby1.Robot_A_ControlState#
Robot (model:
Model_A) control state.Represents the current state of robot real-time control including position, velocity, and torque.
- Variables:
t (float) – Current time in seconds.
is_ready (numpy.ndarray) – Whether the joint is ready for control.
position (numpy.ndarray, shape (DOF,)) – Current joint positions [rad].
velocity (numpy.ndarray, shape (DOF,)) – Current joint velocities [rad/s].
current (numpy.ndarray, shape (DOF,)) – Current joint currents [A].
torque (numpy.ndarray, shape (DOF,)) – Current joint torques [Nm].
- property current#
- property is_ready#
- property position#
- property t#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.Robot_M#
Robot (model:
Model_M) control interface.Provides high-level control interface for robot operations including connection management, power control, and command execution.
- Variables:
model (Model_M) – Robot model configuration.
- brake_engage(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Engage the brake for a device.
- Parameters:
dev_name (str) – Device name (joint name) to engage brake. Supports regex patterns.
Examples
>>> # Engage brake for maintenance >>> robot.brake_engage("right_arm_0")
- brake_release(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
break_release(dev_name)
Release the brake for a device.
- Parameters:
dev_name (str) – Device name (joint name) to release brake. Supports regex patterns.
Examples
>>> # Release brake to allow movement >>> robot.brake_release("right_arm_0")
- cancel_control(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Cancel current control operation.
- connect(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, max_retries: int = 5, timeout_ms: int = 1000) bool#
Attempts to establish a connection with the robot.
- Parameters:
max_retries (int, optional) – Maximum number of retries to connect. Default is 5.
timeout_ms (int, optional) – Timeout in milliseconds for each connection attempt. Default is 1000.
- Returns:
Trueif the connection was successful,Falseotherwise.- Return type:
bool
Examples
>>> robot = rby1_sdk.create_robot("192.168.1.100", "a") >>> if robot.connect(): ... print("Connected to robot") ... else: ... print("Failed to connect") >>> # Default: max_retries=5, timeout_ms=1000 >>> # Custom: robot.connect(max_retries=10, timeout_ms=2000)
- connect_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, ssid: str, password: str = '', use_dhcp: bool = True, ip_address: str = '', gateway: str = '', dns: list[str] = []) bool#
Connect to WiFi network.
- Parameters:
ssid (str) – WiFi network name.
password (str, optional) – WiFi password. Default is empty string.
use_dhcp (bool, optional) – Use DHCP. Default is True.
ip_address (str, optional) – Static IP address. Default is empty string.
gateway (str, optional) – Gateway address. Default is empty string.
dns (list[str], optional) – DNS servers. Default is empty string.
Examples
>>> # Connect using DHCP (automatic IP) >>> robot.connect_wifi("MyWiFi", "mypassword123") >>> # Connect with static IP configuration >>> robot.connect_wifi("MyWiFi", "mypassword123", use_dhcp=False, ... ip_address="192.168.1.100/24", gateway="192.168.1.1") >>> # Connect to open network >>> robot.connect_wifi("OpenNetwork") >>> # Check connection status >>> status = robot.get_wifi_status() >>> print(f"Connected: {status.connected}, SSID: {status.ssid}")
- control(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, control: Callable[[rb_sdk.rb_sdk_cpp.rby1.Robot_M_ControlState], rb_sdk.rb_sdk_cpp.rby1.Robot_M_ControlInput], port: int = 0, priority: int = 1) bool#
Start a blocking real-time control loop using a custom control callback.
This function runs a UDP-based real-time loop that repeatedly calls the user-provided
control(ControlState) -> ControlInput. The loop exits when the callback returns aControlInputwithfinish=True, or when an error/abort occurs. The function returnsTrueonly if it finished viafinish=True; otherwiseFalse.- Parameters:
control (callable) – A callable that accepts a
ControlStateand returns aControlInput. The callback is invoked for each received RT state packet.port (int, optional) – UDP port to bind for the RT server. Use
0to let the OS choose an available port (recommended). Default is0.priority (int, optional) – Command priority sent with the RT control request. Default is
1.
- Returns:
Trueif the loop terminated because the callback setfinish=TrueinControlInput.Falseif the loop ended due to an error or abort (e.g., UDP bind failure, connection issue).- Return type:
bool
Notes
Blocking: This call blocks until the control loop ends. There is no handler for external cancellation. Design the callback to set
finish=Truewhen you want to stop.GIL behavior: The function releases the Python GIL around I/O and reacquires it only when invoking your Python callback, allowing other Python threads to run between callbacks.
Performance: Keep the callback lightweight—avoid long computations or blocking I/O inside the callback to maintain RT responsiveness.
State fields: The provided
ControlStateincludes timestampt, and arrays such asposition,velocity,current, andtorquefor all DoFs of the robot.Errors: If the UDP server fails to bind (e.g., port unavailable), the function returns
Falseimmediately (and prints the error tostderr).
Examples
>>> import numpy as np >>> >>> # Stop after ~2 seconds using state.t >>> t0 = {"t": None} >>> def control_fn(state): ... if t0["t"] is None: ... t0["t"] = state.t ... finish = (state.t - t0["t"]) >= 2.0 ... i = ControlInput() ... i.mode.fill(rby.ControlMode.Position) ... i.target = np.zeros_like(state.position) # hold home ... i.feedback_gain.fill(10) # simple P gain ... i.feedforward_torque.fill(0) # no torque feedforward ... i.finish = finish ... return i >>> ok = robot.control(control_fn) >>> print(ok) # True if finished via finish=True
- static create(address: str) rb_sdk.rb_sdk_cpp.rby1.Robot_M#
Create a robot instance.
- Parameters:
address (str) – Robot network address, e.g. “192.168.1.100:50051”.
- Returns:
Robot instance.
- Return type:
Robot
Examples
>>> import rby1_sdk >>> robot = rby.Robot_A.create("192.168.30.1:50051") >>> robot.connect() >>> if robot.is_connected(): ... print("Robot connected successfully") ... robot_info = robot.get_robot_info() ... print(f"Robot model: {robot.model().model_name}") ... # Note: Model A has mobile base (2-DOF) + torso (6-DOF) + right arm (7-DOF) + left arm (7-DOF) + head (2-DOF) ... # Total joints: 2 + 6 + 7 + 7 + 2 = 24 DOF for model A
- create_command_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, priority: int = 1) rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler#
Create a command stream for continuous command sending.
- Parameters:
priority (int, optional) – Command priority. Default is 1.
- Returns:
Command stream handler.
- Return type:
RobotCommandStreamHandler
Examples
>>> # Create command stream for continuous operation >>> stream_handler = robot.create_command_stream(priority=1) >>> # Send commands continuously >>> for i in range(10): ... command_builder = create_command(i) ... stream_handler.send_command(command_builder, timeout_ms=1000) ... time.sleep(1) >>> # Through the handler, you can terminate control or check the current state >>> stream_handler.cancel() >>> # See examples/python/cartesian_command_stream.py for complete usage
- disable_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Disable the control manager.
- disconnect(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) None#
Disconnects from the robot.
- disconnect_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Disconnect from WiFi network.
- download_file(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, path: str, file_like: object) bool#
Downloads a file from the robot and writes it into a file-like object.
- Parameters:
path (str) – Relative path to the file on the robot’s file system. The base directory is defined by the RBY1_HOME environment variable (default: /root/.rby1).
file_like (file-like object) – Any object with a .write(bytes) method (e.g., io.BytesIO, a real file).
- Returns:
Trueif the file was downloaded successfully.- Return type:
bool
- Raises:
RuntimeError – If the gRPC call fails (e.g., network issue, file not found, internal error).
- enable_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, unlimited_mode_enabled: bool = False) bool#
Enable the control manager.
- Parameters:
unlimited_mode_enabled (bool, optional) – Whether to enable unlimited mode. Default is False.
Examples
>>> # Enable control manager for robot control >>> robot.enable_control_manager() >>> # Enable with unlimited mode (use with caution) >>> robot.enable_control_manager(unlimited_mode_enabled=True) >>> # Must be called before sending commands
- factory_reset_all_parameters(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) None#
Factory reset all parameters to their default values.
- factory_reset_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str) bool#
Factory reset a parameter to its default value.
- Parameters:
name (str) – Parameter name.
- get_control_manager_state(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) rb_sdk.rb_sdk_cpp.rby1.ControlManagerState#
Get control manager state.
- Returns:
Current control manager state.
- Return type:
Examples
>>> # Get control manager state >>> ctrl_state = robot.get_control_manager_state() >>> print(f"Control Manager state: {ctrl_state.state}") >>> print(f"Control state: {ctrl_state.control_state}") >>> # Check if control manager is enabled >>> if ctrl_state.state == rby1_sdk.ControlManagerState.State.Enabled: ... print("Control manager is enabled")
- get_dynamics(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, urdf_model: str = '') rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_26#
Get robot dynamics model.
- Parameters:
urdf_model (str, optional) – URDF model path. Default is empty string.
- Returns:
Robot dynamics model.
- Return type:
dyn.Robot
Examples
>>> # Get dynamics model with the model from connected robot >>> dynamics_robot = robot.get_dynamics() >>> # Get dynamics model with custom URDF >>> dynamics_robot = robot.get_dynamics("/path/to/custom.urdf") >>> # Useful for advanced control algorithms
- get_fault_log_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[str]#
Get fault log list.
- Returns:
List of fault log entries.
- Return type:
list
- get_head_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get head position PID gains.
- Returns:
Head position PID gains.
- Return type:
- get_last_log(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, count: int) list[rb_sdk.rb_sdk_cpp.rby1.Log]#
Get last log entries.
- Parameters:
count (int) – Number of log entries to retrieve.
- Returns:
List of log entries.
- Return type:
list
- get_left_arm_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get left arm position PID gains.
- Returns:
Left arm position PID gains.
- Return type:
- get_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str) str#
Retrieve a robot parameter.
- Parameters:
name (str) – Name of the parameter to retrieve.
- Returns:
Parameter value. Returned as a JSON value: numeric values are returned as-is, strings are enclosed in quotes (”…”).
- Return type:
any
Examples
>>> # Retrieve current parameter values >>> acc_scaling = robot.get_parameter("default.acceleration_limit_scaling") >>> cutoff_freq = robot.get_parameter("joint_position_command.cutoff_frequency") >>> model_name = robot.get_parameter("robot_model_name") >>> print(f"Acceleration scaling: {acc_scaling}") >>> print(f"Cutoff frequency: {cutoff_freq}") >>> print(f"Model name: {model_name}")
- get_parameter_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[tuple[str, int]]#
Get list of available parameters.
- Returns:
List of parameter names.
- Return type:
list
Examples
>>> # Get all available parameters >>> param_list = robot.get_parameter_list() >>> print(f"Total parameters: {len(param_list)}") >>> # List common parameter categories >>> for param in param_list: ... if param[0].startswith("default."): ... print(f"Default param: {param}") ... elif param[0].startswith("joint_position_command."): ... print(f"Joint position param: {param}") >>> # Common categories: default.*, joint_position_command.*, cartesian_command.*
- get_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) rb_sdk.rb_sdk_cpp.rby1.PIDGain#
Get position PID gains for a device.
- Parameters:
dev_name (str) – Device name.
- Returns:
Position PID gains for the device.
- Return type:
Examples
>>> # Get PID gains for specific device >>> torso_pid = robot.get_position_pid_gain("torso_5") >>> print(f"Torso 5 P: {torso_pid.p_gain}, I: {torso_pid.i_gain}, D: {torso_pid.d_gain}") >>> # Get PID gains for arm >>> arm_pid = robot.get_position_pid_gain("right_arm_0") >>> print(f"Right arm 0 P: {arm_pid.p_gain}") >>> devices = ["torso_5", "right_arm_0", "left_arm_1", "head_0"] >>> for device in devices: ... pid = robot.get_position_pid_gain(device) ... print(f"{device}: P={pid.p_gain}, I={pid.i_gain}, D={pid.d_gain}")
- get_right_arm_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get right arm position PID gains.
- Returns:
Right arm position PID gains.
- Return type:
- get_robot_info(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) rb_sdk.rb_sdk_cpp.rby1.RobotInfo#
Retrieves static information about the robot, such as model name, SDK version, and joint configuration.
- Returns:
Structured metadata including joint details, device names, and robot model information.
- Return type:
Examples
>>> # Get robot information >>> robot_info = robot.get_robot_info() >>> print(f"SDK version: {robot_info.sdk_version}") >>> print(f"Robot model name: {robot_info.robot_model_name}") >>> print(f"Robot model version: {robot_info.robot_model_version}") >>> print(f"Joint count: {len(robot_info.joint_infos)}") >>> # Access joint information >>> for joint in robot_info.joint_infos: ... print(f"Joint: {joint.name}, Brake: {joint.has_brake}, Product name: {joint.product_name}, Firmware version: {joint.firmware_version}")
- get_robot_model(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) str#
Get the current robot URDF model.
- Returns:
Current robot model.
- Return type:
RobotModel
- get_serial_device_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[rb_sdk.rb_sdk_cpp.rby1.SerialDevice]#
Get list of available serial devices on the robot.
- Returns:
List of available serial devices.
- Return type:
list
Examples
>>> # Get available serial devices >>> devices = robot.get_serial_device_list() >>> print(f"Found {len(devices)} serial devices") >>> # List device information >>> for device in devices: ... print(f"Path: {device.path}, Description: {device.description}") >>> # Open serial stream to first device >>> if devices: ... stream = robot.open_serial_stream(devices[0].path, 115200) >>> # Common device paths: /dev/ttyUSB0, /dev/ttyACM0, COM1, COM2
- get_state(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) rb_sdk.rb_sdk_cpp.rby1.RobotState_M#
Get current robot state.
- Returns:
Current robot state.
- Return type:
RobotState
Examples
>>> robot_state = robot.get_state() >>> model = robot.model() >>> print(f"Joint positions: {robot_state.position}") >>> print(f"Right arm position: {robot_state.position[model.right_arm_idx]}") >>> # Note: Joint positions include mobile base (2-DOF) + torso (6-DOF) + right arm (7-DOF) + left arm (7-DOF) + head (2-DOF) >>> # Total: 24 DOF for model A, 23 DOF for model M, 26 DOF for model M, 18 DOF for model UB
- get_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) tuple[object, str]#
Get robot system time.
- Returns:
(datetime, str): Robot system time and local time string.
- Return type:
tuple
- get_time_scale(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) float#
Get the current time scale.
- Returns:
Current time scale value.
- Return type:
float
Examples
>>> # Get current time scale >>> current_scale = robot.get_time_scale() >>> print(f"Current time scale: {current_scale}") >>> # Check if robot is running at full speed >>> if current_scale == 1.0: ... print("Robot running at full speed") >>> # Check if robot is slowed down >>> elif current_scale < 1.0: ... print(f"Robot running at {current_scale * 100}% speed")
- get_torso_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get torso position PID gains.
- Returns:
Torso position PID gains.
- Return type:
Examples
>>> # Get current PID gains for torso >>> torso_pid = robot.get_torso_position_pid_gains()[0] # Get first (and only) torso device >>> print(f"Torso P: {torso_pid.p_gain}, I: {torso_pid.i_gain}, D: {torso_pid.d_gain}") >>> right_arm_pid = robot.get_right_arm_position_pid_gains()[0] >>> print(f"Right arm: {right_arm_pid}")
- get_wifi_status(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) rb_sdk.rb_sdk_cpp.rby1.WifiStatus | None#
Get WiFi connection status.
- Returns:
Current WiFi status.
- Return type:
- has_established_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Check if time synchronization is established.
- Returns:
True if time sync is established, False otherwise.
- Return type:
bool
- home_offset_reset(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Reset home offset for a device.
- Parameters:
dev_name (str) – Device name to reset home offset. Supports regex patterns.
- import_robot_model(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str, model: str) bool#
Import a robot model.
- Parameters:
name (str) – Model name.
model (RobotModel) – Robot model to import.
- is_connected(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Checks whether the robot is currently connected.
- Returns:
Trueif the robot is connected to the robot,Falseotherwise.- Return type:
bool
- is_power_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Check if a device is powered on.
- Parameters:
dev_name (str) – Device name to check. Supports regex patterns.
- Returns:
Trueif device is powered on,Falseotherwise.- Return type:
bool
- is_servo_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Check if servo control is enabled for a device.
- Parameters:
dev_name (str) – Device name to check. Supports regex patterns.
- Returns:
Trueif servo control is enabled,Falseotherwise.- Return type:
bool
- static model() rb_sdk.rb_sdk_cpp.rby1.Model_M#
Get the robot model configuration.
- Returns:
Robot model configuration object.
- Return type:
- open_serial_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, device_path: str, baudrate: int, bytesize: int = 8, parity: str = 'N', stopbits: int = 1) rb_sdk.rb_sdk_cpp.rby1.SerialStream#
Open a serial stream.
- Parameters:
device_path (str) – Path to serial device.
baudrate (int) – Baud rate.
bytesize (int, optional) – Data bits. Default is 8.
parity (str, optional) – Parity setting. Default is ‘N’.
stopbits (int, optional) – Stop bits. Default is 1.
- Returns:
Serial stream object.
- Return type:
Examples
>>> # Open serial stream with default settings >>> stream = robot.open_serial_stream("/dev/ttyUSB0", 115200) >>> # Open with custom settings >>> stream = robot.open_serial_stream("/dev/ttyUSB1", 9600, bytesize=7, parity='E', stopbits=2) >>> # Common baudrates: 9600, 19200, 38400, 57600, 115200 >>> # Parity: 'N' (none), 'E' (even), 'O' (odd) >>> # Stop bits: 1, 2
- power_off(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Power off a device.
- Parameters:
dev_name (str) – Device name to power off. Supports regex patterns.
- power_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Power on a device.
- Parameters:
dev_name (str) – Device name to power on. Supports regex patterns.
Examples
>>> robot.connect() >>> if not robot.is_power_on(".*"): ... robot.power_on(".*") ... print("Robot powered on") >>> # Pattern ".*" powers on all devices >>> # Specific device: robot.power_on("12v"), robot.power_on("24v"), etc.
- reset_all_parameters(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) None#
Reset all parameters to their current values.
- reset_all_parameters_to_default(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) None#
Reset all parameters to their default values (deprecated).
Deprecated since version 0.6.0: Use
factory_reset_all_parameters()instead.Note
This method is deprecated. Use factory_reset_all_parameters() instead.
- reset_battery_config(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Reset battery configuration to default.
- reset_fault_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Reset fault in the control manager.
- reset_network_setting(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Reset network settings to default.
- reset_odometry(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, angle: float, position: numpy.ndarray[numpy.float64[2, 1]]) bool#
reset_odometry(angle, position)
Reset odometry to specified values.
- Parameters:
angle (float) – New angle [rad].
position (numpy.ndarray) – New position [m].
Examples
>>> import numpy as np >>> # Reset odometry to origin >>> robot.reset_odometry(angle=0.0, position=np.array([0.0, 0.0])) >>> # Reset to specific position and orientation >>> robot.reset_odometry(angle=np.pi/2, position=np.array([1.0, 2.0])) >>> # Useful for mobile base navigation >>> # Position is [x, y] in meters, angle is yaw in rad
- reset_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str) bool#
Reset a parameter to its current value.
- Parameters:
name (str) – Parameter name.
- reset_parameter_to_default(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str) bool#
Reset a parameter to its default value (deprecated).
- Parameters:
name (str) – Parameter name.
deprecated: (..) – 0.6.0: Use
factory_reset_parameter()instead.
Note
This method is deprecated. Use factory_reset_parameter() instead.
- scan_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) list[rb_sdk.rb_sdk_cpp.rby1.WifiNetwork]#
Scan for available WiFi networks.
- Returns:
List of available WiFi networks.
- Return type:
list
Examples
>>> # Scan for available WiFi networks >>> networks = robot.scan_wifi() >>> print(f"Found {len(networks)} networks") >>> # List network information >>> for network in networks: ... print(f"SSID: {network.ssid}, Signal: {network.signal_strength}") >>> # Connect to a network >>> if networks: ... robot.connect_wifi(networks[0].ssid, "password")
- send_command(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, builder: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, priority: int = 1) rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler#
Send a command to the robot.
- Parameters:
builder (CommandBuilder) – Command builder to send.
priority (int, optional) – Command priority. Default is 1.
- Returns:
Command handler for monitoring execution.
- Return type:
RobotCommandHandler
Examples
>>> from rby1_sdk import RobotCommandBuilder, ComponentBasedCommandBuilder >>> from rby1_sdk import BodyComponentBasedCommandBuilder, JointPositionCommandBuilder >>> # Create command with method chaining (standard pattern) >>> command = RobotCommandBuilder().set_command( ... ComponentBasedCommandBuilder().set_body_command( ... BodyComponentBasedCommandBuilder() ... .set_torso_command( ... JointPositionCommandBuilder() ... .set_position([0, 0, 0, 0, 0, 0]) # 6-DOF torso ... .set_minimum_time(2.0) ... ) ... ) ... ) >>> handler = robot.send_command(command) >>> handler.wait() # Wait for completion >>> # This pattern is used in most examples: examples/python/07_impedance_control.py, 09_demo_motion.py, etc.
- servo_off(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Disable servo control for a device.
- Parameters:
dev_name (str) – Device name to disable servo control. Supports regex patterns.
Examples
>>> # Disable servo control for safety >>> robot.servo_off(".*") # All motor drivers >>> # Specific device: robot.servo_off("^torso_.*")
- servo_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str) bool#
Enable servo control for a device.
- Parameters:
dev_name (str) – Device name to enable servo control. Supports regex patterns.
Examples
>>> robot.connect() >>> if not robot.is_servo_on(".*"): ... robot.servo_on(".*") # Servo on all devices ... print("All devices servoed on") >>> # Specific device: robot.servo_on("^torso_.*"), robot.servo_on("^right_arm_.*"), etc.
- set_battery_config(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, cutoff_voltage: float, fully_charged_voltage: float, coefficients: Annotated[list[float], FixedSize(4)]) bool#
Set battery configuration.
- set_battery_level(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, arg0: float) bool#
Set battery level.
- Parameters:
level (float) – Battery level percentage (0.0 to 100.0).
Examples
>>> # Set battery level for testing >>> robot.set_battery_level(100.0) # Full battery >>> robot.set_battery_level(50.0) # Half battery >>> robot.set_battery_level(25.0) # Quarter battery >>> robot.set_battery_level(0.0) # Empty battery >>> # Range: 0.0 to 100.0 >>> # Useful for using custom battery
- set_led_color(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, color: rb_sdk.rb_sdk_cpp.rby1.Color, duration: float = 1, transition_time: float = 0, blinking: bool = False, blinking_freq: float = 1) bool#
Set LED color.
- Parameters:
color (Color) – LED color.
duration (float, optional) – Duration in seconds. Default is 1.
transition_time (float, optional) – Transition time in seconds. Default is 0.
blinking (bool, optional) – Whether to blink. Default is False.
blinking_freq (float, optional) – Blinking frequency in Hz. Default is 1.
Examples
>>> from rby1_sdk import Color >>> # Set LED to red for 5 seconds >>> robot.set_led_color(Color(255, 0, 0), duration=5.0) >>> # Set LED to green with 1 second transition >>> robot.set_led_color(Color(0, 255, 0), transition_time=1.0) >>> # Set LED to blue with blinking >>> robot.set_led_color(Color(0, 0, 255), blinking=True, blinking_freq=2.0) >>> # Set LED to white with custom duration and transition >>> robot.set_led_color(Color(255, 255, 255), duration=10.0, transition_time=2.0)
- set_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str, value: str, write_db: bool = True) bool#
Set a robot parameter.
- Parameters:
name (str) – Parameter name.
value (any) – Parameter value.
write_db (bool, optional) – Whether to write to database. Default is True.
Examples
>>> # Set acceleration limit scaling >>> robot.set_parameter("default.acceleration_limit_scaling", "0.8") >>> # Set joint position command cutoff frequency >>> robot.set_parameter("joint_position_command.cutoff_frequency", "5") >>> # Set hotspot SSID name >>> robot.set_parameter("hotspot.ssid", "\"RBY1_HOTSPOT\"") # For str value, use escaped quotes >>> # Set without writing to database (Return ``False`` if matching parameter not found) >>> robot.set_parameter("temp.parameter", "value", write_db=False) False
- set_position_d_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str, d_gain: int) bool#
Set position D gain for a device.
- Parameters:
dev_name (str) – Device name.
d_gain (int) – D gain value.
Examples
>>> # Set D gain for specific devices >>> robot.set_position_d_gain("torso_5", 400)
- set_position_i_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str, i_gain: int) bool#
Set position I gain for a device.
- Parameters:
dev_name (str) – Device name.
i_gain (int) – I gain value.
Examples
>>> # Set I gain for specific devices >>> robot.set_position_i_gain("torso_5", 40)
- set_position_p_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str, p_gain: int) bool#
Set position P gain for a device.
- Parameters:
dev_name (str) – Device name.
p_gain (int) – P gain value.
Examples
>>> # Set P gain for specific devices >>> robot.set_position_p_gain("torso_5", 220)
- set_position_pid_gain(*args, **kwargs)#
Overloaded function.
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str, p_gain: int, i_gain: int, d_gain: int) -> bool
Set position PID gains for a device.
- Parameters:
dev_name (str) – Device name.
p_gain (int) – P gain value.
i_gain (int) – I gain value.
d_gain (int) – D gain value.
- Returns:
True if successful, False otherwise.
- Return type:
bool
Examples
>>> # Set all PID gains at once for a device >>> robot.set_position_pid_gain("right_arm_0", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_1", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_2", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_3", 35, 5, 80) >>> robot.set_position_pid_gain("right_arm_4", 30, 5, 70) >>> robot.set_position_pid_gain("right_arm_5", 30, 5, 70) >>> robot.set_position_pid_gain("right_arm_6", 100, 5, 120)
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, dev_name: str, pid_gain: rb_sdk.rb_sdk_cpp.rby1.PIDGain) -> bool
Set position PID gains for a device using PIDGain object.
- Parameters:
dev_name (str) – Device name.
pid_gain (PIDGain) – PID gain object.
- Returns:
True if successful, False otherwise.
- Return type:
bool
- set_preset_position(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, joint_name: str) bool#
Set preset position for a joint (only available for PVL-based motors).
- Parameters:
joint_name (str) – Joint name to set preset position.
Examples
>>> # Set preset position for specific joints >>> robot.set_preset_position("right_arm_6") # Right arm joint 6 >>> # Preset position is used as reference for home offset
- set_system_time(*args, **kwargs)#
Overloaded function.
set_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, datetime: object) -> bool
Set robot system time.
- Parameters:
datetime (datetime.datetime) – New system time.
set_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, datetime: object, time_zone: str) -> bool
Set robot system time with timezone.
- Parameters:
datetime (datetime.datetime) – New system time.
time_zone (str) – Timezone string.
- set_time_scale(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, time_scale: float) float#
Set the time scale for motion execution.
- Parameters:
time_scale (float) – Time scale value (0.0 to 1.0).
Examples
>>> # Set time scale for motion execution >>> robot.set_time_scale(1.0) # Normal speed (100%) >>> robot.set_time_scale(0.5) # Half speed (50%) >>> robot.set_time_scale(0.25) # Quarter speed (25%) >>> # Range: 0.0 (stopped) to 1.0 (full speed) >>> # Useful for testing and safety
- set_tool_flange_digital_output(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str, channel: int, state: bool) bool#
Set the digital output state of a specific channel on the tool flange of the specified arm.
- Parameters:
name (str) – Arm identifier. Must be either “right” or “left”, indicating the tool flange of the right or left arm.
channel (int) – Digital output channel index.
state (bool) – Desired state of the digital output (
True= ON,False= OFF).
- Returns:
Trueif the command was successfully sent,Falseotherwise.- Return type:
bool
Examples
>>> # Turn on channel 0 on the right arm tool flange >>> robot.set_tool_flange_digital_output("right", 0, True)
- set_tool_flange_digital_output_dual(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str, state_0: bool, state_1: bool) bool#
Set the digital output states of two channels on the tool flange of the specified arm simultaneously.
- Parameters:
name (str) – Arm identifier. Must be either “right” or “left”, indicating the tool flange of the right or left arm.
state_0 (bool) – Desired state for digital output channel 0 (True = ON, False = OFF).
state_1 (bool) – Desired state for digital output channel 1 (True = ON, False = OFF).
- Returns:
Trueif the command was successfully sent,Falseotherwise.- Return type:
bool
Examples
>>> # Turn on channel 0 and turn off channel 1 on the left arm tool flange >>> robot.set_tool_flange_digital_output_dual("left", True, False)
- set_tool_flange_output_voltage(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, name: str, voltage: int) bool#
Set tool flange output voltage.
- Parameters:
name (str) – Tool flange name “right” or “left”.
voltage (int) – Output voltage in volts.
Examples
>>> # Set tool flange output voltage >>> robot.set_tool_flange_output_voltage("right", 12) # 12V output >>> robot.set_tool_flange_output_voltage("left", 24) # 24V output >>> # Common voltages: 12V, 24V >>> # Use 0V to turn off output >>> # Note: This method sets voltage for both tool flanges (right and left)
- start_log_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, cb: Callable[[list[rb_sdk.rb_sdk_cpp.rby1.Log]], None], rate: float) None#
Start log stream callback.
- Parameters:
cb (callable) – Callback function for log updates.
rate (float) – Update rate in Hz.
Examples
>>> def log_callback(log_entries): ... for log in log_entries: ... print(f"{log.timestamp} - {log.level} - {log.message}") >>> # Start log stream at 10 Hz >>> robot.start_log_stream(log_callback, 10.0) >>> # Stop when done: robot.stop_log_stream()
- start_state_update(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, cb: Callable, rate: float) None#
Start state update callback.
- Parameters:
cb (callable) – Callback function with 1 or 2 parameters: - cb(robot_state) or cb(robot_state, control_manager_state)
rate (float) – Update rate in Hz.
Examples
>>> def state_callback(robot_state): ... print(f"Timestamp: {robot_state.timestamp}, Joint positions: {robot_state.position}") >>> # Start state updates at 100 Hz >>> robot.start_state_update(state_callback, 100.0) >>> # Stop when done: robot.stop_state_update()
- start_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, period_sec: int) bool#
Start time synchronization.
- Parameters:
period_sec (float) – Synchronization period in seconds.
- stop_log_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) None#
Stop log stream callback.
- stop_state_update(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) None#
Stop state update callback.
- stop_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Stop time synchronization.
- sync_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M) bool#
Synchronizes the timestamp of
RobotStateto UPC time instead of UTC. Useful when synchronizing multiple devices to UPC time.
- wait_for_control_ready(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M, timeout_ms: int) bool#
Wait until the robot is ready to accept control commands.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif the robot is ready to accept control (you can now set control).Falseif the timeout expired before the robot became ready.- Return type:
bool
Examples
>>> # Wait for control to be ready >>> if robot.wait_for_control_ready(timeout_ms=5000): ... print("Control is ready, you can now set control commands.") ... else: ... print("Timeout: control is not ready.") >>> # Call after servo_on() and before sending control commands
- class rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler#
Robot (model:
Model_M) command handler.Handles robot command execution and provides status monitoring.
- cancel(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler) None#
Cancel the command execution.
- get(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Wait for the command execution and get feedback
- Returns:
Current feedback information.
- Return type:
- get_status(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler) bool#
Get gRPC status
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler) bool#
Check if the command execution is complete.
- Returns:
Trueif command is complete,Falseotherwise.- Return type:
bool
- wait(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler) None#
Wait for the command execution to complete.
This method blocks until the command is done or cancelled.
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandHandler, timeout_ms: int) bool#
Wait for the command execution with timeout.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif command completed,Falseif timeout.- Return type:
bool
- class rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler#
Robot (model:
Model_M) command stream handler.Handles robot command execution through streaming with send and feedback capabilities.
- Variables:
is_done (bool) – Whether the command execution is complete.
- cancel(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler) None#
Cancel the current command execution.
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler) bool#
Check if the command execution is complete.
- Returns:
True if command is complete, False otherwise.
- Return type:
bool
- request_feedback(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Request feedback from the robot.
- Parameters:
timeout_ms (int, optional) – Timeout in milliseconds. Default is 1000.
- Returns:
Current feedback information.
- Return type:
- send_command(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler, builder: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Send a command through the stream.
- Parameters:
builder (CommandBuilder) – Command builder to send.
timeout_ms (int, optional) – Timeout in milliseconds. Default is 1000.
- Returns:
Current feedback information.
- Return type:
- wait(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler) None#
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.Robot_M_CommandStreamHandler, timeout_ms: int) bool#
Wait for the command execution to complete.
This method blocks until the command is done or cancelled.
- class rb_sdk.rb_sdk_cpp.rby1.Robot_M_ControlInput#
Robot (model:
Model_M) control input.Represents control input parameters for robot real-time control including mode, target, and gains.
- Variables:
mode (numpy.ndarray) – Control mode for each joint (boolean array).
target (numpy.ndarray) – Target positions for each joint [rad].
feedback_gain (numpy.ndarray) – Feedback gains for each joint.
feedforward_torque (numpy.ndarray) – Feedforward torque for each joint [Nm].
finish (bool) – Whether to finish the current control operation.
- property feedback_gain#
- property feedforward_torque#
- property finish#
- property mode#
- property target#
- class rb_sdk.rb_sdk_cpp.rby1.Robot_M_ControlState#
Robot (model:
Model_M) control state.Represents the current state of robot real-time control including position, velocity, and torque.
- Variables:
t (float) – Current time in seconds.
is_ready (numpy.ndarray) – Whether the joint is ready for control.
position (numpy.ndarray, shape (DOF,)) – Current joint positions [rad].
velocity (numpy.ndarray, shape (DOF,)) – Current joint velocities [rad/s].
current (numpy.ndarray, shape (DOF,)) – Current joint currents [A].
torque (numpy.ndarray, shape (DOF,)) – Current joint torques [Nm].
- property current#
- property is_ready#
- property position#
- property t#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.Robot_UB#
Robot (model:
Model_UB) control interface.Provides high-level control interface for robot operations including connection management, power control, and command execution.
- Variables:
model (Model_UB) – Robot model configuration.
- brake_engage(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Engage the brake for a device.
- Parameters:
dev_name (str) – Device name (joint name) to engage brake. Supports regex patterns.
Examples
>>> # Engage brake for maintenance >>> robot.brake_engage("right_arm_0")
- brake_release(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
break_release(dev_name)
Release the brake for a device.
- Parameters:
dev_name (str) – Device name (joint name) to release brake. Supports regex patterns.
Examples
>>> # Release brake to allow movement >>> robot.brake_release("right_arm_0")
- cancel_control(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Cancel current control operation.
- connect(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, max_retries: int = 5, timeout_ms: int = 1000) bool#
Attempts to establish a connection with the robot.
- Parameters:
max_retries (int, optional) – Maximum number of retries to connect. Default is 5.
timeout_ms (int, optional) – Timeout in milliseconds for each connection attempt. Default is 1000.
- Returns:
Trueif the connection was successful,Falseotherwise.- Return type:
bool
Examples
>>> robot = rby1_sdk.create_robot("192.168.1.100", "a") >>> if robot.connect(): ... print("Connected to robot") ... else: ... print("Failed to connect") >>> # Default: max_retries=5, timeout_ms=1000 >>> # Custom: robot.connect(max_retries=10, timeout_ms=2000)
- connect_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, ssid: str, password: str = '', use_dhcp: bool = True, ip_address: str = '', gateway: str = '', dns: list[str] = []) bool#
Connect to WiFi network.
- Parameters:
ssid (str) – WiFi network name.
password (str, optional) – WiFi password. Default is empty string.
use_dhcp (bool, optional) – Use DHCP. Default is True.
ip_address (str, optional) – Static IP address. Default is empty string.
gateway (str, optional) – Gateway address. Default is empty string.
dns (list[str], optional) – DNS servers. Default is empty string.
Examples
>>> # Connect using DHCP (automatic IP) >>> robot.connect_wifi("MyWiFi", "mypassword123") >>> # Connect with static IP configuration >>> robot.connect_wifi("MyWiFi", "mypassword123", use_dhcp=False, ... ip_address="192.168.1.100/24", gateway="192.168.1.1") >>> # Connect to open network >>> robot.connect_wifi("OpenNetwork") >>> # Check connection status >>> status = robot.get_wifi_status() >>> print(f"Connected: {status.connected}, SSID: {status.ssid}")
- control(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, control: Callable[[rb_sdk.rb_sdk_cpp.rby1.Robot_UB_ControlState], rb_sdk.rb_sdk_cpp.rby1.Robot_UB_ControlInput], port: int = 0, priority: int = 1) bool#
Start a blocking real-time control loop using a custom control callback.
This function runs a UDP-based real-time loop that repeatedly calls the user-provided
control(ControlState) -> ControlInput. The loop exits when the callback returns aControlInputwithfinish=True, or when an error/abort occurs. The function returnsTrueonly if it finished viafinish=True; otherwiseFalse.- Parameters:
control (callable) – A callable that accepts a
ControlStateand returns aControlInput. The callback is invoked for each received RT state packet.port (int, optional) – UDP port to bind for the RT server. Use
0to let the OS choose an available port (recommended). Default is0.priority (int, optional) – Command priority sent with the RT control request. Default is
1.
- Returns:
Trueif the loop terminated because the callback setfinish=TrueinControlInput.Falseif the loop ended due to an error or abort (e.g., UDP bind failure, connection issue).- Return type:
bool
Notes
Blocking: This call blocks until the control loop ends. There is no handler for external cancellation. Design the callback to set
finish=Truewhen you want to stop.GIL behavior: The function releases the Python GIL around I/O and reacquires it only when invoking your Python callback, allowing other Python threads to run between callbacks.
Performance: Keep the callback lightweight—avoid long computations or blocking I/O inside the callback to maintain RT responsiveness.
State fields: The provided
ControlStateincludes timestampt, and arrays such asposition,velocity,current, andtorquefor all DoFs of the robot.Errors: If the UDP server fails to bind (e.g., port unavailable), the function returns
Falseimmediately (and prints the error tostderr).
Examples
>>> import numpy as np >>> >>> # Stop after ~2 seconds using state.t >>> t0 = {"t": None} >>> def control_fn(state): ... if t0["t"] is None: ... t0["t"] = state.t ... finish = (state.t - t0["t"]) >= 2.0 ... i = ControlInput() ... i.mode.fill(rby.ControlMode.Position) ... i.target = np.zeros_like(state.position) # hold home ... i.feedback_gain.fill(10) # simple P gain ... i.feedforward_torque.fill(0) # no torque feedforward ... i.finish = finish ... return i >>> ok = robot.control(control_fn) >>> print(ok) # True if finished via finish=True
- static create(address: str) rb_sdk.rb_sdk_cpp.rby1.Robot_UB#
Create a robot instance.
- Parameters:
address (str) – Robot network address, e.g. “192.168.1.100:50051”.
- Returns:
Robot instance.
- Return type:
Robot
Examples
>>> import rby1_sdk >>> robot = rby.Robot_A.create("192.168.30.1:50051") >>> robot.connect() >>> if robot.is_connected(): ... print("Robot connected successfully") ... robot_info = robot.get_robot_info() ... print(f"Robot model: {robot.model().model_name}") ... # Note: Model A has mobile base (2-DOF) + torso (6-DOF) + right arm (7-DOF) + left arm (7-DOF) + head (2-DOF) ... # Total joints: 2 + 6 + 7 + 7 + 2 = 24 DOF for model A
- create_command_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, priority: int = 1) rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler#
Create a command stream for continuous command sending.
- Parameters:
priority (int, optional) – Command priority. Default is 1.
- Returns:
Command stream handler.
- Return type:
RobotCommandStreamHandler
Examples
>>> # Create command stream for continuous operation >>> stream_handler = robot.create_command_stream(priority=1) >>> # Send commands continuously >>> for i in range(10): ... command_builder = create_command(i) ... stream_handler.send_command(command_builder, timeout_ms=1000) ... time.sleep(1) >>> # Through the handler, you can terminate control or check the current state >>> stream_handler.cancel() >>> # See examples/python/cartesian_command_stream.py for complete usage
- disable_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Disable the control manager.
- disconnect(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) None#
Disconnects from the robot.
- disconnect_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Disconnect from WiFi network.
- download_file(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, path: str, file_like: object) bool#
Downloads a file from the robot and writes it into a file-like object.
- Parameters:
path (str) – Relative path to the file on the robot’s file system. The base directory is defined by the RBY1_HOME environment variable (default: /root/.rby1).
file_like (file-like object) – Any object with a .write(bytes) method (e.g., io.BytesIO, a real file).
- Returns:
Trueif the file was downloaded successfully.- Return type:
bool
- Raises:
RuntimeError – If the gRPC call fails (e.g., network issue, file not found, internal error).
- enable_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, unlimited_mode_enabled: bool = False) bool#
Enable the control manager.
- Parameters:
unlimited_mode_enabled (bool, optional) – Whether to enable unlimited mode. Default is False.
Examples
>>> # Enable control manager for robot control >>> robot.enable_control_manager() >>> # Enable with unlimited mode (use with caution) >>> robot.enable_control_manager(unlimited_mode_enabled=True) >>> # Must be called before sending commands
- factory_reset_all_parameters(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) None#
Factory reset all parameters to their default values.
- factory_reset_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str) bool#
Factory reset a parameter to its default value.
- Parameters:
name (str) – Parameter name.
- get_control_manager_state(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) rb_sdk.rb_sdk_cpp.rby1.ControlManagerState#
Get control manager state.
- Returns:
Current control manager state.
- Return type:
Examples
>>> # Get control manager state >>> ctrl_state = robot.get_control_manager_state() >>> print(f"Control Manager state: {ctrl_state.state}") >>> print(f"Control state: {ctrl_state.control_state}") >>> # Check if control manager is enabled >>> if ctrl_state.state == rby1_sdk.ControlManagerState.State.Enabled: ... print("Control manager is enabled")
- get_dynamics(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, urdf_model: str = '') rb_sdk.rb_sdk_cpp.rby1.dynamics.Robot_18#
Get robot dynamics model.
- Parameters:
urdf_model (str, optional) – URDF model path. Default is empty string.
- Returns:
Robot dynamics model.
- Return type:
dyn.Robot
Examples
>>> # Get dynamics model with the model from connected robot >>> dynamics_robot = robot.get_dynamics() >>> # Get dynamics model with custom URDF >>> dynamics_robot = robot.get_dynamics("/path/to/custom.urdf") >>> # Useful for advanced control algorithms
- get_fault_log_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[str]#
Get fault log list.
- Returns:
List of fault log entries.
- Return type:
list
- get_head_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get head position PID gains.
- Returns:
Head position PID gains.
- Return type:
- get_last_log(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, count: int) list[rb_sdk.rb_sdk_cpp.rby1.Log]#
Get last log entries.
- Parameters:
count (int) – Number of log entries to retrieve.
- Returns:
List of log entries.
- Return type:
list
- get_left_arm_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get left arm position PID gains.
- Returns:
Left arm position PID gains.
- Return type:
- get_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str) str#
Retrieve a robot parameter.
- Parameters:
name (str) – Name of the parameter to retrieve.
- Returns:
Parameter value. Returned as a JSON value: numeric values are returned as-is, strings are enclosed in quotes (”…”).
- Return type:
any
Examples
>>> # Retrieve current parameter values >>> acc_scaling = robot.get_parameter("default.acceleration_limit_scaling") >>> cutoff_freq = robot.get_parameter("joint_position_command.cutoff_frequency") >>> model_name = robot.get_parameter("robot_model_name") >>> print(f"Acceleration scaling: {acc_scaling}") >>> print(f"Cutoff frequency: {cutoff_freq}") >>> print(f"Model name: {model_name}")
- get_parameter_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[tuple[str, int]]#
Get list of available parameters.
- Returns:
List of parameter names.
- Return type:
list
Examples
>>> # Get all available parameters >>> param_list = robot.get_parameter_list() >>> print(f"Total parameters: {len(param_list)}") >>> # List common parameter categories >>> for param in param_list: ... if param[0].startswith("default."): ... print(f"Default param: {param}") ... elif param[0].startswith("joint_position_command."): ... print(f"Joint position param: {param}") >>> # Common categories: default.*, joint_position_command.*, cartesian_command.*
- get_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) rb_sdk.rb_sdk_cpp.rby1.PIDGain#
Get position PID gains for a device.
- Parameters:
dev_name (str) – Device name.
- Returns:
Position PID gains for the device.
- Return type:
Examples
>>> # Get PID gains for specific device >>> torso_pid = robot.get_position_pid_gain("torso_5") >>> print(f"Torso 5 P: {torso_pid.p_gain}, I: {torso_pid.i_gain}, D: {torso_pid.d_gain}") >>> # Get PID gains for arm >>> arm_pid = robot.get_position_pid_gain("right_arm_0") >>> print(f"Right arm 0 P: {arm_pid.p_gain}") >>> devices = ["torso_5", "right_arm_0", "left_arm_1", "head_0"] >>> for device in devices: ... pid = robot.get_position_pid_gain(device) ... print(f"{device}: P={pid.p_gain}, I={pid.i_gain}, D={pid.d_gain}")
- get_right_arm_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get right arm position PID gains.
- Returns:
Right arm position PID gains.
- Return type:
- get_robot_info(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) rb_sdk.rb_sdk_cpp.rby1.RobotInfo#
Retrieves static information about the robot, such as model name, SDK version, and joint configuration.
- Returns:
Structured metadata including joint details, device names, and robot model information.
- Return type:
Examples
>>> # Get robot information >>> robot_info = robot.get_robot_info() >>> print(f"SDK version: {robot_info.sdk_version}") >>> print(f"Robot model name: {robot_info.robot_model_name}") >>> print(f"Robot model version: {robot_info.robot_model_version}") >>> print(f"Joint count: {len(robot_info.joint_infos)}") >>> # Access joint information >>> for joint in robot_info.joint_infos: ... print(f"Joint: {joint.name}, Brake: {joint.has_brake}, Product name: {joint.product_name}, Firmware version: {joint.firmware_version}")
- get_robot_model(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) str#
Get the current robot URDF model.
- Returns:
Current robot model.
- Return type:
RobotModel
- get_serial_device_list(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[rb_sdk.rb_sdk_cpp.rby1.SerialDevice]#
Get list of available serial devices on the robot.
- Returns:
List of available serial devices.
- Return type:
list
Examples
>>> # Get available serial devices >>> devices = robot.get_serial_device_list() >>> print(f"Found {len(devices)} serial devices") >>> # List device information >>> for device in devices: ... print(f"Path: {device.path}, Description: {device.description}") >>> # Open serial stream to first device >>> if devices: ... stream = robot.open_serial_stream(devices[0].path, 115200) >>> # Common device paths: /dev/ttyUSB0, /dev/ttyACM0, COM1, COM2
- get_state(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) rb_sdk.rb_sdk_cpp.rby1.RobotState_UB#
Get current robot state.
- Returns:
Current robot state.
- Return type:
RobotState
Examples
>>> robot_state = robot.get_state() >>> model = robot.model() >>> print(f"Joint positions: {robot_state.position}") >>> print(f"Right arm position: {robot_state.position[model.right_arm_idx]}") >>> # Note: Joint positions include mobile base (2-DOF) + torso (6-DOF) + right arm (7-DOF) + left arm (7-DOF) + head (2-DOF) >>> # Total: 24 DOF for model A, 23 DOF for model M, 26 DOF for model M, 18 DOF for model UB
- get_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) tuple[object, str]#
Get robot system time.
- Returns:
(datetime, str): Robot system time and local time string.
- Return type:
tuple
- get_time_scale(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) float#
Get the current time scale.
- Returns:
Current time scale value.
- Return type:
float
Examples
>>> # Get current time scale >>> current_scale = robot.get_time_scale() >>> print(f"Current time scale: {current_scale}") >>> # Check if robot is running at full speed >>> if current_scale == 1.0: ... print("Robot running at full speed") >>> # Check if robot is slowed down >>> elif current_scale < 1.0: ... print(f"Robot running at {current_scale * 100}% speed")
- get_torso_position_pid_gains(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[rb_sdk.rb_sdk_cpp.rby1.PIDGain]#
Get torso position PID gains.
- Returns:
Torso position PID gains.
- Return type:
Examples
>>> # Get current PID gains for torso >>> torso_pid = robot.get_torso_position_pid_gains()[0] # Get first (and only) torso device >>> print(f"Torso P: {torso_pid.p_gain}, I: {torso_pid.i_gain}, D: {torso_pid.d_gain}") >>> right_arm_pid = robot.get_right_arm_position_pid_gains()[0] >>> print(f"Right arm: {right_arm_pid}")
- get_wifi_status(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) rb_sdk.rb_sdk_cpp.rby1.WifiStatus | None#
Get WiFi connection status.
- Returns:
Current WiFi status.
- Return type:
- has_established_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Check if time synchronization is established.
- Returns:
True if time sync is established, False otherwise.
- Return type:
bool
- home_offset_reset(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Reset home offset for a device.
- Parameters:
dev_name (str) – Device name to reset home offset. Supports regex patterns.
- import_robot_model(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str, model: str) bool#
Import a robot model.
- Parameters:
name (str) – Model name.
model (RobotModel) – Robot model to import.
- is_connected(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Checks whether the robot is currently connected.
- Returns:
Trueif the robot is connected to the robot,Falseotherwise.- Return type:
bool
- is_power_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Check if a device is powered on.
- Parameters:
dev_name (str) – Device name to check. Supports regex patterns.
- Returns:
Trueif device is powered on,Falseotherwise.- Return type:
bool
- is_servo_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Check if servo control is enabled for a device.
- Parameters:
dev_name (str) – Device name to check. Supports regex patterns.
- Returns:
Trueif servo control is enabled,Falseotherwise.- Return type:
bool
- static model() rb_sdk.rb_sdk_cpp.rby1.Model_UB#
Get the robot model configuration.
- Returns:
Robot model configuration object.
- Return type:
- open_serial_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, device_path: str, baudrate: int, bytesize: int = 8, parity: str = 'N', stopbits: int = 1) rb_sdk.rb_sdk_cpp.rby1.SerialStream#
Open a serial stream.
- Parameters:
device_path (str) – Path to serial device.
baudrate (int) – Baud rate.
bytesize (int, optional) – Data bits. Default is 8.
parity (str, optional) – Parity setting. Default is ‘N’.
stopbits (int, optional) – Stop bits. Default is 1.
- Returns:
Serial stream object.
- Return type:
Examples
>>> # Open serial stream with default settings >>> stream = robot.open_serial_stream("/dev/ttyUSB0", 115200) >>> # Open with custom settings >>> stream = robot.open_serial_stream("/dev/ttyUSB1", 9600, bytesize=7, parity='E', stopbits=2) >>> # Common baudrates: 9600, 19200, 38400, 57600, 115200 >>> # Parity: 'N' (none), 'E' (even), 'O' (odd) >>> # Stop bits: 1, 2
- power_off(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Power off a device.
- Parameters:
dev_name (str) – Device name to power off. Supports regex patterns.
- power_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Power on a device.
- Parameters:
dev_name (str) – Device name to power on. Supports regex patterns.
Examples
>>> robot.connect() >>> if not robot.is_power_on(".*"): ... robot.power_on(".*") ... print("Robot powered on") >>> # Pattern ".*" powers on all devices >>> # Specific device: robot.power_on("12v"), robot.power_on("24v"), etc.
- reset_all_parameters(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) None#
Reset all parameters to their current values.
- reset_all_parameters_to_default(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) None#
Reset all parameters to their default values (deprecated).
Deprecated since version 0.6.0: Use
factory_reset_all_parameters()instead.Note
This method is deprecated. Use factory_reset_all_parameters() instead.
- reset_battery_config(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Reset battery configuration to default.
- reset_fault_control_manager(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Reset fault in the control manager.
- reset_network_setting(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Reset network settings to default.
- reset_odometry(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, angle: float, position: numpy.ndarray[numpy.float64[2, 1]]) bool#
reset_odometry(angle, position)
Reset odometry to specified values.
- Parameters:
angle (float) – New angle [rad].
position (numpy.ndarray) – New position [m].
Examples
>>> import numpy as np >>> # Reset odometry to origin >>> robot.reset_odometry(angle=0.0, position=np.array([0.0, 0.0])) >>> # Reset to specific position and orientation >>> robot.reset_odometry(angle=np.pi/2, position=np.array([1.0, 2.0])) >>> # Useful for mobile base navigation >>> # Position is [x, y] in meters, angle is yaw in rad
- reset_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str) bool#
Reset a parameter to its current value.
- Parameters:
name (str) – Parameter name.
- reset_parameter_to_default(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str) bool#
Reset a parameter to its default value (deprecated).
- Parameters:
name (str) – Parameter name.
deprecated: (..) – 0.6.0: Use
factory_reset_parameter()instead.
Note
This method is deprecated. Use factory_reset_parameter() instead.
- scan_wifi(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) list[rb_sdk.rb_sdk_cpp.rby1.WifiNetwork]#
Scan for available WiFi networks.
- Returns:
List of available WiFi networks.
- Return type:
list
Examples
>>> # Scan for available WiFi networks >>> networks = robot.scan_wifi() >>> print(f"Found {len(networks)} networks") >>> # List network information >>> for network in networks: ... print(f"SSID: {network.ssid}, Signal: {network.signal_strength}") >>> # Connect to a network >>> if networks: ... robot.connect_wifi(networks[0].ssid, "password")
- send_command(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, builder: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, priority: int = 1) rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler#
Send a command to the robot.
- Parameters:
builder (CommandBuilder) – Command builder to send.
priority (int, optional) – Command priority. Default is 1.
- Returns:
Command handler for monitoring execution.
- Return type:
RobotCommandHandler
Examples
>>> from rby1_sdk import RobotCommandBuilder, ComponentBasedCommandBuilder >>> from rby1_sdk import BodyComponentBasedCommandBuilder, JointPositionCommandBuilder >>> # Create command with method chaining (standard pattern) >>> command = RobotCommandBuilder().set_command( ... ComponentBasedCommandBuilder().set_body_command( ... BodyComponentBasedCommandBuilder() ... .set_torso_command( ... JointPositionCommandBuilder() ... .set_position([0, 0, 0, 0, 0, 0]) # 6-DOF torso ... .set_minimum_time(2.0) ... ) ... ) ... ) >>> handler = robot.send_command(command) >>> handler.wait() # Wait for completion >>> # This pattern is used in most examples: examples/python/07_impedance_control.py, 09_demo_motion.py, etc.
- servo_off(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Disable servo control for a device.
- Parameters:
dev_name (str) – Device name to disable servo control. Supports regex patterns.
Examples
>>> # Disable servo control for safety >>> robot.servo_off(".*") # All motor drivers >>> # Specific device: robot.servo_off("^torso_.*")
- servo_on(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str) bool#
Enable servo control for a device.
- Parameters:
dev_name (str) – Device name to enable servo control. Supports regex patterns.
Examples
>>> robot.connect() >>> if not robot.is_servo_on(".*"): ... robot.servo_on(".*") # Servo on all devices ... print("All devices servoed on") >>> # Specific device: robot.servo_on("^torso_.*"), robot.servo_on("^right_arm_.*"), etc.
- set_battery_config(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, cutoff_voltage: float, fully_charged_voltage: float, coefficients: Annotated[list[float], FixedSize(4)]) bool#
Set battery configuration.
- set_battery_level(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, arg0: float) bool#
Set battery level.
- Parameters:
level (float) – Battery level percentage (0.0 to 100.0).
Examples
>>> # Set battery level for testing >>> robot.set_battery_level(100.0) # Full battery >>> robot.set_battery_level(50.0) # Half battery >>> robot.set_battery_level(25.0) # Quarter battery >>> robot.set_battery_level(0.0) # Empty battery >>> # Range: 0.0 to 100.0 >>> # Useful for using custom battery
- set_led_color(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, color: rb_sdk.rb_sdk_cpp.rby1.Color, duration: float = 1, transition_time: float = 0, blinking: bool = False, blinking_freq: float = 1) bool#
Set LED color.
- Parameters:
color (Color) – LED color.
duration (float, optional) – Duration in seconds. Default is 1.
transition_time (float, optional) – Transition time in seconds. Default is 0.
blinking (bool, optional) – Whether to blink. Default is False.
blinking_freq (float, optional) – Blinking frequency in Hz. Default is 1.
Examples
>>> from rby1_sdk import Color >>> # Set LED to red for 5 seconds >>> robot.set_led_color(Color(255, 0, 0), duration=5.0) >>> # Set LED to green with 1 second transition >>> robot.set_led_color(Color(0, 255, 0), transition_time=1.0) >>> # Set LED to blue with blinking >>> robot.set_led_color(Color(0, 0, 255), blinking=True, blinking_freq=2.0) >>> # Set LED to white with custom duration and transition >>> robot.set_led_color(Color(255, 255, 255), duration=10.0, transition_time=2.0)
- set_parameter(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str, value: str, write_db: bool = True) bool#
Set a robot parameter.
- Parameters:
name (str) – Parameter name.
value (any) – Parameter value.
write_db (bool, optional) – Whether to write to database. Default is True.
Examples
>>> # Set acceleration limit scaling >>> robot.set_parameter("default.acceleration_limit_scaling", "0.8") >>> # Set joint position command cutoff frequency >>> robot.set_parameter("joint_position_command.cutoff_frequency", "5") >>> # Set hotspot SSID name >>> robot.set_parameter("hotspot.ssid", "\"RBY1_HOTSPOT\"") # For str value, use escaped quotes >>> # Set without writing to database (Return ``False`` if matching parameter not found) >>> robot.set_parameter("temp.parameter", "value", write_db=False) False
- set_position_d_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str, d_gain: int) bool#
Set position D gain for a device.
- Parameters:
dev_name (str) – Device name.
d_gain (int) – D gain value.
Examples
>>> # Set D gain for specific devices >>> robot.set_position_d_gain("torso_5", 400)
- set_position_i_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str, i_gain: int) bool#
Set position I gain for a device.
- Parameters:
dev_name (str) – Device name.
i_gain (int) – I gain value.
Examples
>>> # Set I gain for specific devices >>> robot.set_position_i_gain("torso_5", 40)
- set_position_p_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str, p_gain: int) bool#
Set position P gain for a device.
- Parameters:
dev_name (str) – Device name.
p_gain (int) – P gain value.
Examples
>>> # Set P gain for specific devices >>> robot.set_position_p_gain("torso_5", 220)
- set_position_pid_gain(*args, **kwargs)#
Overloaded function.
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str, p_gain: int, i_gain: int, d_gain: int) -> bool
Set position PID gains for a device.
- Parameters:
dev_name (str) – Device name.
p_gain (int) – P gain value.
i_gain (int) – I gain value.
d_gain (int) – D gain value.
- Returns:
True if successful, False otherwise.
- Return type:
bool
Examples
>>> # Set all PID gains at once for a device >>> robot.set_position_pid_gain("right_arm_0", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_1", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_2", 80, 15, 200) >>> robot.set_position_pid_gain("right_arm_3", 35, 5, 80) >>> robot.set_position_pid_gain("right_arm_4", 30, 5, 70) >>> robot.set_position_pid_gain("right_arm_5", 30, 5, 70) >>> robot.set_position_pid_gain("right_arm_6", 100, 5, 120)
set_position_pid_gain(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, dev_name: str, pid_gain: rb_sdk.rb_sdk_cpp.rby1.PIDGain) -> bool
Set position PID gains for a device using PIDGain object.
- Parameters:
dev_name (str) – Device name.
pid_gain (PIDGain) – PID gain object.
- Returns:
True if successful, False otherwise.
- Return type:
bool
- set_preset_position(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, joint_name: str) bool#
Set preset position for a joint (only available for PVL-based motors).
- Parameters:
joint_name (str) – Joint name to set preset position.
Examples
>>> # Set preset position for specific joints >>> robot.set_preset_position("right_arm_6") # Right arm joint 6 >>> # Preset position is used as reference for home offset
- set_system_time(*args, **kwargs)#
Overloaded function.
set_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, datetime: object) -> bool
Set robot system time.
- Parameters:
datetime (datetime.datetime) – New system time.
set_system_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, datetime: object, time_zone: str) -> bool
Set robot system time with timezone.
- Parameters:
datetime (datetime.datetime) – New system time.
time_zone (str) – Timezone string.
- set_time_scale(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, time_scale: float) float#
Set the time scale for motion execution.
- Parameters:
time_scale (float) – Time scale value (0.0 to 1.0).
Examples
>>> # Set time scale for motion execution >>> robot.set_time_scale(1.0) # Normal speed (100%) >>> robot.set_time_scale(0.5) # Half speed (50%) >>> robot.set_time_scale(0.25) # Quarter speed (25%) >>> # Range: 0.0 (stopped) to 1.0 (full speed) >>> # Useful for testing and safety
- set_tool_flange_digital_output(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str, channel: int, state: bool) bool#
Set the digital output state of a specific channel on the tool flange of the specified arm.
- Parameters:
name (str) – Arm identifier. Must be either “right” or “left”, indicating the tool flange of the right or left arm.
channel (int) – Digital output channel index.
state (bool) – Desired state of the digital output (
True= ON,False= OFF).
- Returns:
Trueif the command was successfully sent,Falseotherwise.- Return type:
bool
Examples
>>> # Turn on channel 0 on the right arm tool flange >>> robot.set_tool_flange_digital_output("right", 0, True)
- set_tool_flange_digital_output_dual(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str, state_0: bool, state_1: bool) bool#
Set the digital output states of two channels on the tool flange of the specified arm simultaneously.
- Parameters:
name (str) – Arm identifier. Must be either “right” or “left”, indicating the tool flange of the right or left arm.
state_0 (bool) – Desired state for digital output channel 0 (True = ON, False = OFF).
state_1 (bool) – Desired state for digital output channel 1 (True = ON, False = OFF).
- Returns:
Trueif the command was successfully sent,Falseotherwise.- Return type:
bool
Examples
>>> # Turn on channel 0 and turn off channel 1 on the left arm tool flange >>> robot.set_tool_flange_digital_output_dual("left", True, False)
- set_tool_flange_output_voltage(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, name: str, voltage: int) bool#
Set tool flange output voltage.
- Parameters:
name (str) – Tool flange name “right” or “left”.
voltage (int) – Output voltage in volts.
Examples
>>> # Set tool flange output voltage >>> robot.set_tool_flange_output_voltage("right", 12) # 12V output >>> robot.set_tool_flange_output_voltage("left", 24) # 24V output >>> # Common voltages: 12V, 24V >>> # Use 0V to turn off output >>> # Note: This method sets voltage for both tool flanges (right and left)
- start_log_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, cb: Callable[[list[rb_sdk.rb_sdk_cpp.rby1.Log]], None], rate: float) None#
Start log stream callback.
- Parameters:
cb (callable) – Callback function for log updates.
rate (float) – Update rate in Hz.
Examples
>>> def log_callback(log_entries): ... for log in log_entries: ... print(f"{log.timestamp} - {log.level} - {log.message}") >>> # Start log stream at 10 Hz >>> robot.start_log_stream(log_callback, 10.0) >>> # Stop when done: robot.stop_log_stream()
- start_state_update(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, cb: Callable, rate: float) None#
Start state update callback.
- Parameters:
cb (callable) – Callback function with 1 or 2 parameters: - cb(robot_state) or cb(robot_state, control_manager_state)
rate (float) – Update rate in Hz.
Examples
>>> def state_callback(robot_state): ... print(f"Timestamp: {robot_state.timestamp}, Joint positions: {robot_state.position}") >>> # Start state updates at 100 Hz >>> robot.start_state_update(state_callback, 100.0) >>> # Stop when done: robot.stop_state_update()
- start_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, period_sec: int) bool#
Start time synchronization.
- Parameters:
period_sec (float) – Synchronization period in seconds.
- stop_log_stream(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) None#
Stop log stream callback.
- stop_state_update(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) None#
Stop state update callback.
- stop_time_sync(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Stop time synchronization.
- sync_time(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB) bool#
Synchronizes the timestamp of
RobotStateto UPC time instead of UTC. Useful when synchronizing multiple devices to UPC time.
- wait_for_control_ready(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB, timeout_ms: int) bool#
Wait until the robot is ready to accept control commands.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif the robot is ready to accept control (you can now set control).Falseif the timeout expired before the robot became ready.- Return type:
bool
Examples
>>> # Wait for control to be ready >>> if robot.wait_for_control_ready(timeout_ms=5000): ... print("Control is ready, you can now set control commands.") ... else: ... print("Timeout: control is not ready.") >>> # Call after servo_on() and before sending control commands
- class rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler#
Robot (model:
Model_UB) command handler.Handles robot command execution and provides status monitoring.
- cancel(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler) None#
Cancel the command execution.
- get(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Wait for the command execution and get feedback
- Returns:
Current feedback information.
- Return type:
- get_status(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler) bool#
Get gRPC status
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler) bool#
Check if the command execution is complete.
- Returns:
Trueif command is complete,Falseotherwise.- Return type:
bool
- wait(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler) None#
Wait for the command execution to complete.
This method blocks until the command is done or cancelled.
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandHandler, timeout_ms: int) bool#
Wait for the command execution with timeout.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif command completed,Falseif timeout.- Return type:
bool
- class rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler#
Robot (model:
Model_UB) command stream handler.Handles robot command execution through streaming with send and feedback capabilities.
- Variables:
is_done (bool) – Whether the command execution is complete.
- cancel(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler) None#
Cancel the current command execution.
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler) bool#
Check if the command execution is complete.
- Returns:
True if command is complete, False otherwise.
- Return type:
bool
- request_feedback(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Request feedback from the robot.
- Parameters:
timeout_ms (int, optional) – Timeout in milliseconds. Default is 1000.
- Returns:
Current feedback information.
- Return type:
- send_command(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler, builder: rb_sdk.rb_sdk_cpp.rby1.RobotCommandBuilder, timeout_ms: int = 1000) rb_sdk.rb_sdk_cpp.rby1.RobotCommandFeedback#
Send a command through the stream.
- Parameters:
builder (CommandBuilder) – Command builder to send.
timeout_ms (int, optional) – Timeout in milliseconds. Default is 1000.
- Returns:
Current feedback information.
- Return type:
- wait(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler) None#
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.Robot_UB_CommandStreamHandler, timeout_ms: int) bool#
Wait for the command execution to complete.
This method blocks until the command is done or cancelled.
- class rb_sdk.rb_sdk_cpp.rby1.Robot_UB_ControlInput#
Robot (model:
Model_UB) control input.Represents control input parameters for robot real-time control including mode, target, and gains.
- Variables:
mode (numpy.ndarray) – Control mode for each joint (boolean array).
target (numpy.ndarray) – Target positions for each joint [rad].
feedback_gain (numpy.ndarray) – Feedback gains for each joint.
feedforward_torque (numpy.ndarray) – Feedforward torque for each joint [Nm].
finish (bool) – Whether to finish the current control operation.
- property feedback_gain#
- property feedforward_torque#
- property finish#
- property mode#
- property target#
- class rb_sdk.rb_sdk_cpp.rby1.Robot_UB_ControlState#
Robot (model:
Model_UB) control state.Represents the current state of robot real-time control including position, velocity, and torque.
- Variables:
t (float) – Current time in seconds.
is_ready (numpy.ndarray) – Whether the joint is ready for control.
position (numpy.ndarray, shape (DOF,)) – Current joint positions [rad].
velocity (numpy.ndarray, shape (DOF,)) – Current joint velocities [rad/s].
current (numpy.ndarray, shape (DOF,)) – Current joint currents [A].
torque (numpy.ndarray, shape (DOF,)) – Current joint torques [Nm].
- property current#
- property is_ready#
- property position#
- property t#
- property torque#
- property velocity#
- class rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder#
SE(2) velocity command builder.
Defines planar velocity commands in SE(2) space (x, y translation and yaw rotation). The target velocity is reached by linear ramp-up/ramp-down subject to acceleration limits and the specified minimum execution time.
Examples
Move forward at 0.5 m/s while yawing at 0.2 rad/s, with limits and minimum time:
>>> import numpy as np, rby1_sdk as rby >>> se2 = ( ... rby.SE2VelocityCommandBuilder() ... .set_velocity(np.array([0.5, 0.0]), 0.2) # [vx, vy], wz ... .set_acceleration_limit(np.array([1.0, 1.0]), 0.5) ... .set_minimum_time(1.0) ... ) >>> # (Optional) hold the commanded velocity after ramping: >>> header = rby.CommandHeaderBuilder().set_control_hold_time(3.0) >>> se2.set_command_header(header) >>> cmd = rby.RobotCommandBuilder().set_command( ... rby.ComponentBasedCommandBuilder().set_mobility_command( ... rby.MobilityCommandBuilder().set_command(se2) ... ) ... ) >>> # robot.send_command(cmd, priority=1).get()
- set_acceleration_limit(self: rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder, linear: numpy.ndarray[numpy.float64[2, 1]], angular: float) rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder#
Set maximum acceleration limits for the SE(2) command.
- Parameters:
linear (numpy.ndarray, shape (2,), dtype=float64) – Maximum linear accelerations along x and y axes [m/s²].
angular (float) – Maximum angular acceleration around the z-axis [rad/s²].
- Returns:
Self reference for method chaining.
- Return type:
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- set_minimum_time(self: rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder, minimum_time: float) rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder#
Set the minimum execution time.
- Parameters:
minimum_time (float) – Minimum execution time [s]. Ensures the ramp toward the target velocity spans at least this duration.
- Returns:
Self reference for method chaining.
- Return type:
- set_velocity(self: rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder, linear: numpy.ndarray[numpy.float64[2, 1]], angular: float) rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandBuilder#
Set the target SE(2) velocity.
- Parameters:
linear (numpy.ndarray, shape (2,), dtype=float64) – Linear velocity along x and y axes [m/s].
angular (float) – Angular velocity around the z-axis [rad/s].
- Returns:
Self reference for method chaining.
- Return type:
Notes
To maintain the commanded velocity after reaching it, set a control hold time via
CommandHeaderBuilderand attach it withset_command_header.
- class rb_sdk.rb_sdk_cpp.rby1.SE2VelocityCommandFeedback#
Feedback for an SE(2) base velocity command.
(Contains only header-level fields via :pyattr:`CommandFeedback.command_header`.)
- class rb_sdk.rb_sdk_cpp.rby1.SerialDevice#
Serial device information.
Represents information about a serial device.
- Variables:
path (str) – Device path (e.g., “/dev/ttyUSB0”).
description (str) – Device description.
- property description#
- property path#
- class rb_sdk.rb_sdk_cpp.rby1.SerialStream#
Serial communication stream.
Provides serial communication functionality with read/write operations and callback support.
- Variables:
is_opened (bool) – Whether the stream is currently open.
is_cancelled (bool) – Whether the stream operation was cancelled.
is_done (bool) – Whether the stream operation is complete.
- connect(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, verbose: bool) bool#
Connect to the serial device.
- Parameters:
verbose (bool) – Whether to enable verbose output.
- Returns:
True if connection successful, False otherwise.
- Return type:
bool
- disconnect(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream) None#
Disconnect from the serial device.
- is_cancelled(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream) bool#
Check if the stream operation was cancelled.
- Returns:
True if operation was cancelled, False otherwise.
- Return type:
bool
- is_done(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream) bool#
is_done()
Check if the stream operation is complete.
- Returns:
True if operation is complete, False otherwise.
- Return type:
bool
- is_opened(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream) bool#
is_opened()
Check if the stream is currently open.
- Returns:
True if stream is open, False otherwise.
- Return type:
bool
- set_read_callback(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, arg0: Callable[[bytes], None]) None#
Set a callback function for read operations.
- Parameters:
cb (callable) – Callback function that receives bytes data.
Examples
>>> dev = robot.open_serial_stream(device_path, baudrate) >>> connected = dev.connect(verbose=True) >>> if not connected: ... print("Failed to connect") ... exit(1) >>> print("Listening for incoming data...\n") >>> def print_hex(data): ... hex_string = "".join(f"{int(ch):02X}" for ch in data) ... print(f"<< {hex_string}", flush=True) >>> dev.set_read_callback(print_hex)
- wait(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream) None#
Wait for the stream operation to complete.
This method blocks until the operation is done or cancelled.
- wait_for(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, timeout_ms: int) bool#
Wait for the stream operation with timeout.
- Parameters:
timeout_ms (int) – Timeout in milliseconds.
- Returns:
Trueif operation completed,Falseif timeout.- Return type:
bool
- write(*args, **kwargs)#
Overloaded function.
write(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, data: str) -> bool
Write character data to the serial stream.
- Parameters:
data (str) – Character data to write.
write(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, data: str) -> bool
Write character data with specified length to the serial stream.
- Parameters:
data (str) – Character data to write.
n (int) – Number of characters to write.
write(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, data: str, n: int) -> bool
Write character data with specified length to the serial stream.
- Parameters:
data (str) – Character data to write.
n (int) – Number of characters to write.
- write_byte(self: rb_sdk.rb_sdk_cpp.rby1.SerialStream, ch: str) bool#
Write a single byte to the serial stream.
- Parameters:
ch (int) – Byte value to write [0, 255].
- class rb_sdk.rb_sdk_cpp.rby1.StopCommandBuilder#
Stop command builder.
Generates a stop command that halts all robot motion immediately. Typically used in whole-body command contexts to enforce a safe and deterministic stop.
Examples
>>> import rby1_sdk as rby >>> stop = rby.StopCommandBuilder() >>> cmd = rby.RobotCommandBuilder().set_command( ... rby.WholeBodyCommandBuilder().set_command(stop) ... ) >>> # robot.send_command(cmd, priority=1).get()
- set_command_header(self: rb_sdk.rb_sdk_cpp.rby1.StopCommandBuilder, command_header_builder: rb_sdk.rb_sdk_cpp.rby1.CommandHeaderBuilder) rb_sdk.rb_sdk_cpp.rby1.StopCommandBuilder#
Attach a command header.
- Parameters:
command_header_builder (CommandHeaderBuilder) – Command header configuration (e.g., control hold time).
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.StopCommandFeedback#
Feedback for a whole-body stop command.
(Contains only header-level fields via :pyattr:`CommandFeedback.command_header`.)
- class rb_sdk.rb_sdk_cpp.rby1.SystemStat#
System statistics information.
Provides information about system performance including CPU and memory usage.
- Variables:
cpu_usage (float) – CPU usage percentage [0.0, 100.0].
memory_usage (float) – Memory usage percentage [0.0, 100.0].
uptime (float) – System uptime in seconds.
program_uptime (float) – Program uptime in seconds.
- property cpu_usage#
- property memory_usage#
- property program_uptime#
- property uptime#
- class rb_sdk.rb_sdk_cpp.rby1.ToolFlangeState#
Tool flange state information.
Provides information about tool flange sensors and outputs.
- Variables:
time_since_last_update (datetime.timedelta) – Time since last update as a Python timedelta.
gyro (numpy.ndarray, shape (3,), dtype=float64) – Gyroscope readings [rad/s].
acceleration (numpy.ndarray, shape (3,), dtype=float64) – Acceleration readings in m/s².
switch_A (bool) – Status of switch A.
output_voltage (float) – Output voltage in volts.
digital_input_A (bool) – Status of digital input A.
digital_input_B (bool) – Status of digital input B.
digital_output_A (bool) – Status of digital output A.
digital_output_B (bool) – Status of digital output B.
- property acceleration#
- property digital_input_A#
- property digital_input_B#
- property digital_output_A#
- property digital_output_B#
- property gyro#
- property output_voltage#
- property switch_A#
- property time_since_last_update#
- class rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder#
Torso command builder.
Builds commands specifically for the torso component. Accepts different command types (joint position, impedance, Cartesian, etc.) and wraps them into a torso command.
Notes
You can pass a command builder (e.g., JointPositionCommandBuilder) directly into .set_torso_command(…) without explicitly creating a TorsoCommandBuilder. Implicit casting automatically wraps it: TorsoCommandBuilder(JointPositionCommandBuilder) is created internally. Therefore, directly using TorsoCommandBuilder is often unnecessary unless you want to explicitly wrap or extend torso-specific logic.
Examples
>>> import numpy as np, rby1_sdk as rby >>> torso_cmd = ( ... rby.TorsoCommandBuilder( ... rby.JointPositionCommandBuilder().set_position(np.zeros(6)) ... ) ... )
- set_command(*args, **kwargs)#
Overloaded function.
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, joint_position_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointPositionCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a joint position builder.
- Parameters:
joint_position_command_builder (JointPositionCommandBuilder) – Command specifying torso joint positions.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, gravity_compensation_command_builder: rb_sdk.rb_sdk_cpp.rby1.GravityCompensationCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a gravity compensation builder.
- Parameters:
gravity_compensation_command_builder (GravityCompensationCommandBuilder) – Command enabling/disabling torso gravity compensation.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, cartesian_command_builder: rb_sdk.rb_sdk_cpp.rby1.CartesianCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a Cartesian builder.
- Parameters:
cartesian_command_builder (CartesianCommandBuilder) – Command specifying Cartesian pose targets for the torso.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.ImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a Cartesian impedance builder.
- Parameters:
impedance_control_command_builder (ImpedanceControlCommandBuilder) – Command specifying Cartesian impedance for the torso.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, optimal_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.OptimalControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from an optimal control builder.
- Parameters:
optimal_control_command_builder (OptimalControlCommandBuilder) – Command specifying optimal control targets/costs for the torso.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, joint_impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a joint impedance builder.
- Parameters:
joint_impedance_control_command_builder (JointImpedanceControlCommandBuilder) – Command specifying joint-space impedance for the torso.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, cartesian_impedance_control_command_builder: rb_sdk.rb_sdk_cpp.rby1.CartesianImpedanceControlCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a Cartesian impedance builder.
- Parameters:
cartesian_impedance_control_command_builder (CartesianImpedanceControlCommandBuilder) – Command specifying Cartesian impedance control for the torso.
- Returns:
Self reference for method chaining.
- Return type:
set_command(self: rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder, joint_group_position_command_builder: rb_sdk.rb_sdk_cpp.rby1.JointGroupPositionCommandBuilder) -> rb_sdk.rb_sdk_cpp.rby1.TorsoCommandBuilder
Set the torso command from a joint group position builder.
- Parameters:
joint_group_position_command_builder (JointGroupPositionCommandBuilder) – Command specifying joint positions for a named torso joint group.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.TorsoCommandFeedback#
Feedback for a torso command container.
- Variables:
joint_position_command (JointPositionCommandFeedback) – Feedback for a joint position command (if present).
gravity_compensation_command (GravityCompensationCommandFeedback) – Feedback for a gravity compensation command (if present).
cartesian_command (CartesianCommandFeedback) – Feedback for a Cartesian command (if present).
impedance_control_command (ImpedanceControlCommandFeedback) – Feedback for a Cartesian impedance command (if present).
optimal_control_command (OptimalControlCommandFeedback) – Feedback for an optimal-control command (if present).
cartesian_impedance_control_command (CartesianImpedanceControlCommandFeedback) – Feedback for a Cartesian impedance (OC + joint-space impedance) command (if present).
joint_impedance_control_command (JointImpedanceControlCommandFeedback) – Feedback for a joint-space impedance command (if present).
joint_group_position_command (JointGroupPositionCommandFeedback) – Feedback for a joint-group position command (if present).
- property cartesian_command#
Cartesian command feedback.
- Returns:
Feedback object.
- Return type:
- property cartesian_impedance_control_command#
Cartesian impedance (OC + joint-space impedance) command feedback.
- Returns:
Feedback object.
- Return type:
- property gravity_compensation_command#
Gravity compensation command feedback.
- Returns:
Feedback object.
- Return type:
- property impedance_control_command#
Cartesian impedance command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_group_position_command#
Joint-group position command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_impedance_control_command#
Joint-space impedance command feedback.
- Returns:
Feedback object.
- Return type:
- property joint_position_command#
Joint position command feedback.
- Returns:
Feedback object.
- Return type:
- property optimal_control_command#
Optimal-control command feedback.
- Returns:
Feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.WholeBodyCommandBuilder#
Whole-body command builder.
Provides a builder interface to construct commands that apply to the entire robot. Currently, its primary role is to wrap and send a StopCommand to halt all motion.
Notes
While ComponentBasedCommandBuilder targets subsystems (mobility, body, head), WholeBodyCommandBuilder applies at the global level.
Examples
>>> import rby1_sdk as rby >>> # Construct a stop command for the whole robot >>> stop = rby.StopCommandBuilder() >>> whole = rby.WholeBodyCommandBuilder().set_command(stop) >>> cmd = rby.RobotCommandBuilder().set_command(whole) >>> # robot.send_command(cmd, priority=0).get()
- set_command(self: rb_sdk.rb_sdk_cpp.rby1.WholeBodyCommandBuilder, stop_command_builder: rb_sdk.rb_sdk_cpp.rby1.StopCommandBuilder) rb_sdk.rb_sdk_cpp.rby1.WholeBodyCommandBuilder#
Assign a stop command to the whole body.
- Parameters:
stop_command_builder (StopCommandBuilder) – Stop command to apply globally.
- Returns:
Self reference for method chaining.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.WholeBodyCommandFeedback#
Feedback for a whole-body command container.
- Variables:
stop_command (StopCommandFeedback) – Feedback of the contained stop command (if present).
- property stop_command#
Contained stop command feedback.
- Returns:
Stop command feedback object.
- Return type:
- class rb_sdk.rb_sdk_cpp.rby1.WifiNetwork#
WiFi network information.
This class represents information about a detected WiFi network including its SSID, signal strength, and security status.
- Variables:
ssid (str) – Service Set Identifier (network name).
signal_strength (int) – Signal strength in dBm (decibels relative to milliwatts). Higher values indicate stronger signals. Typical range: -100 (very weak) to -30 (very strong).
secured (bool) – Whether the network requires a password for connection. (True if the network requires a password, False otherwise.)
- property secured#
- property signal_strength#
- property ssid#
- class rb_sdk.rb_sdk_cpp.rby1.WifiStatus#
Current WiFi connection status.
This class represents the current status of a WiFi connection including connection details and network configuration.
- Variables:
ssid (str) – Service Set Identifier of the connected network.
ip_address (str) – IP address assigned to the device.
gateway (str) – Gateway IP address for the network.
dns (list[str]) – List of DNS server IP addresses.
connected (bool) – Whether the device is currently connected to WiFi.
- property connected#
- property dns#
- property gateway#
- property ip_address#
- property ssid#
- rb_sdk.rb_sdk_cpp.rby1.create_robot_a(address: str) rb_sdk.rb_sdk_cpp.rby1.Robot_A#
Create a
Robot_Ainstance.- Parameters:
address (str) – Network address of the robot, e.g. “192.168.1.100:50051”.
- Returns:
Configured Robot A instance.
- Return type:
Robot
Examples
>>> from rby1_sdk import create_robot_a >>> robot = create_robot_a("192.168.1.100:50051")
- rb_sdk.rb_sdk_cpp.rby1.create_robot_m(address: str) rb_sdk.rb_sdk_cpp.rby1.Robot_M#
Create a
Robot_Minstance.- Parameters:
address (str) – Network address of the robot, e.g. “192.168.1.100:50051”.
- Returns:
Configured Robot M instance.
- Return type:
Robot
Examples
>>> from rby1_sdk import create_robot_m >>> robot = create_robot_m("192.168.1.100:50051")
- rb_sdk.rb_sdk_cpp.rby1.create_robot_ub(address: str) rb_sdk.rb_sdk_cpp.rby1.Robot_UB#
Create a
Robot_UBinstance.- Parameters:
address (str) – Network address of the robot, e.g. “192.168.1.100:50051”.
- Returns:
Configured Robot UB instance.
- Return type:
Robot
Examples
>>> from rby1_sdk import create_robot_ub >>> robot = create_robot_ub("192.168.1.100:50051")
- class rb_sdk.rb_sdk_cpp.rby1.printoptions#
Context manager for temporary print options.
Creates a thread-local scoped override of printing behavior for SDK objects and NumPy arrays. Upon exit, previous options are restored.
array_mode=’numpy’ delegates arrays to NumPy’s global printoptions; scalar formatting and multiline_repr still apply as configured.
Examples
>>> import rby1_sdk as sdk >>> with sdk.printoptions(array_mode='preview', precision=3, multiline_repr=False): ... print(obj) # one-line **str**, precision=3 ... print(repr(obj)) # one-line **repr** (multiline_repr=False) >>> with sdk.printoptions(array_mode='full', multiline_repr=True): ... print(repr(obj)) # multi-line repr with full arrays
- rb_sdk.rb_sdk_cpp.rby1.set_printoptions(array_mode: str | None = None, linewidth: int | None = None, precision: int | None = None, edgeitems: int | None = None, threshold: int | None = None, suppress_small: bool | None = None, multiline_repr: bool | None = None, float_style: str | None = None, sign: str | None = None, trim_trailing_zeros: bool | None = None, scope: str | None = 'thread') None#
Set global or thread-local rby1_sdk print options.
Controls how SDK objects and NumPy arrays are rendered by __repr__/__str__. array_mode=’numpy’ delegates array printing entirely to NumPy’s global printoptions. preview/full make the SDK pass its options explicitly.
multiline_repr toggles `__repr__` only; by convention __str__ is kept one line.
- Parameters:
array_mode ({'numpy', 'preview', 'full'}, optional) –
‘numpy’ : Fully delegate arrays to NumPy’s global printoptions.
’preview’: Use SDK preview policy (threshold/edgeitems/linewidth/precision/sign/…).
’full’ : Print full arrays (ignore threshold), other options still apply.
linewidth (int, optional) – Target maximum line width for arrays (passed to NumPy when not ‘numpy’).
precision (int, optional) – Decimal precision for scalars and arrays.
edgeitems (int, optional) – Number of leading/trailing items to show when summarizing arrays.
threshold (int, optional) – Total number of array elements that triggers summarization (ellipsis).
suppress_small (bool, optional) – If True, very small floats are printed as 0 in arrays (when not ‘numpy’).
multiline_repr (bool, optional) – If True, top-level __repr__ of complex SDK objects uses multi-line, field-per-line formatting. Nested objects should be rendered one-line where reasonable.
float_style ({'auto', 'default', 'fixed', 'scientific'}, optional) – Floating formatting style for scalars and (when not ‘numpy’) arrays.
sign ({'auto', 'minus', 'plus', 'space'}, optional) – Sign policy. ‘space’ shows a leading space for positive numbers.
trim_trailing_zeros (bool, optional) – If True, trailing zeros after the decimal point are trimmed (1.200 -> ‘1.2’).
scope ({'thread', 'global'}, optional) –
‘thread’ (default): apply to the current Python thread (thread-local stack top).
’global’ : update process-wide defaults.
Notes
Options are maintained on a thread-local stack. Repeated calls update the top-of-stack for the current thread; using scope=’global’ updates process-wide defaults.
For temporary changes, prefer the context manager printoptions(…) below.
Examples
>>> import rby1_sdk as rby >>> rby.set_printoptions(array_mode='numpy', precision=4) # arrays follow NumPy global config; scalars use precision=4 >>> with rby.printoptions(array_mode='preview', precision=2, multiline_repr=True): ... print(obj) # one-line **str** with precision=2 ... print(repr(obj)) # multi-line **repr** (since multiline_repr=True)