Utils API¤
ExpHandler¤
RakudaExpHandler¤
RakudaExpHandler
¤
RakudaExpHandler(rakuda_config: RakudaConfig, fps: int = 10)
Bases: ExpHandler
This class handles the experimental interface for the Rakuda robot.
Sensors: 1x Realsense, 2x Digit,
Example:
from robopy.utils.exp_interface import RakudaExpHandler
handler = RakudaExpHandler(
leader_port="/dev/ttyUSB0",
follower_port="/dev/ttyUSB1",
left_digit_serial="D20542",
right_digit_serial="D20537",
fps=30,
)
handler.record_save(max_frames=150, save_path="test_01", if_async=True)
init initialize Rakuda experimental handler
PARAMETER | DESCRIPTION |
---|---|
leader_port
|
leader serial port
TYPE:
|
follower_port
|
follower serial port
TYPE:
|
left_digit_serial
|
left digit serial number
TYPE:
|
right_digit_serial
|
right digit serial number
TYPE:
|
fps
|
The frequency to capture obs. Defaults to 10
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
fps must be between 1 and 30 |
RuntimeError
|
failed to connect to Rakuda robot |
METHOD | DESCRIPTION |
---|---|
recode_save |
record and save data from Rakuda robot |
record |
record data from Rakuda robot |
record_save |
Alias for recode_save kept for backward compatibility. |
send |
send leader action to Rakuda robot |
Source code in src/robopy/utils/exp_interface/rakuda_exp_handler.py
recode_save
¤
recode_save(max_frames: int, save_path: str, if_async: bool = True, save_gif: bool = True, warmup_time: int = 5) -> None
record and save data from Rakuda robot
PARAMETER | DESCRIPTION |
---|---|
max_frames
|
maximum number of frames to record
TYPE:
|
save_path
|
path to save the recorded data:
TYPE:
|
if_async
|
if a . Defaults to True.
TYPE:
|
save_gif
|
if save gif. Defaults to True.
TYPE:
|
warmup_time
|
warm up time before recording. Defaults to 5.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
RuntimeError
|
failed to record from Rakuda robot |
RuntimeError
|
failed to save data |
Source code in src/robopy/utils/exp_interface/rakuda_exp_handler.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
record
¤
record(max_frames: int, if_async: bool = True) -> RakudaObs
record data from Rakuda robot
PARAMETER | DESCRIPTION |
---|---|
max_frames
|
maximum number of frames to record
TYPE:
|
if_async
|
If use parallel. Defaults to True.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
RuntimeError
|
failed to record from Rakuda robot |
RETURNS | DESCRIPTION |
---|---|
RakudaObs
|
recorded observation
TYPE:
|
Source code in src/robopy/utils/exp_interface/rakuda_exp_handler.py
record_save
¤
record_save(max_frames: int, save_path: str, if_async: bool = True, save_gif: bool = True, warmup_time: int = 5) -> None
Alias for recode_save kept for backward compatibility.