ロボットAPI¤
このページでは、Robopyのロボット制御に関連するAPIを説明します。
RakudaRobot¤
RakudaRobot
¤
RakudaRobot(cfg: RakudaConfig)
Bases: ComposedRobot
METHOD | DESCRIPTION |
---|---|
connect |
|
disconnect |
|
teleoperation |
Start teleoperation for Rakuda robot. |
record |
|
record_parallel |
teleoperate_stepをteleop_hzで回しつつ、fpsごとに最新のarm_obsを記録し、 |
Source code in src/robopy/robots/rakuda/rakuda_robot.py
connect
¤
disconnect
¤
teleoperation
¤
Start teleoperation for Rakuda robot.
Source code in src/robopy/robots/rakuda/rakuda_robot.py
record
¤
record(max_frame: int, fps: int = 5) -> RakudaObs
Source code in src/robopy/robots/rakuda/rakuda_robot.py
record_parallel
¤
record_parallel(max_frame: int, fps: int = 30, teleop_hz: int = 100, max_processing_time_ms: float = 25.0) -> RakudaObs
teleoperate_stepをteleop_hzで回しつつ、fpsごとに最新のarm_obsを記録し、 センサデータは並列取得する高速記録。
Source code in src/robopy/robots/rakuda/rakuda_robot.py
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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
RakudaConfig
dataclass
¤
RakudaConfig(leader_port: str, follower_port: str, sensors: RakudaSensorParams | None = None, slow_mode: bool = False)
Configuration class for Rakuda robot.
RakudaPairSys
¤
RakudaPairSys(cfg: RakudaConfig)
Bases: Robot
Class representing the Rakuda robotic system with both leader and follower arms.
METHOD | DESCRIPTION |
---|---|
connect |
Connect to both leader and follower arms. |
disconnect |
Disconnect from both leader and follower arms. |
get_observation |
Get the current observation from both arms. |
Source code in src/robopy/robots/rakuda/rakuda_pair_sys.py
connect
¤
Connect to both leader and follower arms.
Source code in src/robopy/robots/rakuda/rakuda_pair_sys.py
disconnect
¤
get_observation
¤
Get the current observation from both arms.
Source code in src/robopy/robots/rakuda/rakuda_pair_sys.py
RakudaLeader
¤
RakudaLeader(cfg: RakudaConfig)
Bases: RakudaArm
Class representing the leader arm of the Rakuda robotic system.
METHOD | DESCRIPTION |
---|---|
connect |
|
disconnect |
|
RakudaFollower
¤
RakudaFollower(cfg: RakudaConfig)
Bases: RakudaArm
Class representing the follower arm of the Rakuda robotic system.
METHOD | DESCRIPTION |
---|---|
connect |
Connect to the follower arm and enable torque. |
disconnect |
Disconnect from the follower arm and disable torque. |
KochRobot
¤
KochRobot(cfg: KochConfig)
Bases: ComposedRobot
METHOD | DESCRIPTION |
---|---|
connect |
|
disconnect |
|
teleoperation |
Start teleoperation mode where leader controls follower. |
使用例¤
基本的なRakudaRobotの使用¤
from robopy import RakudaConfig, RakudaRobot
# 設定の作成
config = RakudaConfig(
leader_port="/dev/ttyUSB0",
follower_port="/dev/ttyUSB1"
)
# ロボットの作成と接続
robot = RakudaRobot(config)
robot.connect()
try:
# テレオペレーション
robot.teleoperation(duration=10)
# データ記録
obs = robot.record_parallel(max_frame=1000, fps=30)
finally:
robot.disconnect()
個別アームの制御¤
from robopy.robots.rakuda import RakudaLeader, RakudaFollower
# 個別アームの作成
leader = RakudaLeader("/dev/ttyUSB0")
follower = RakudaFollower("/dev/ttyUSB1")
leader.connect()
follower.connect()
try:
# Leaderから観測データを取得
leader_obs = leader.get_obs()
# Followerに動作指令を送信
follower.set_action(leader_obs["action"])
finally:
leader.disconnect()
follower.disconnect()