Moby gRPC Client Python API
Moby gRPC API List
Get EtherCAT Tx/Rx data
Command | Description | Parameters | Return Type |
---|---|---|---|
get_motor_dirver_tx(slave_num: int) |
Get the EtherCAT Tx data of motor driver by index. | slave_num: int |
dict |
get_motor_dirver_rx(slave_num: int) |
Get the EtherCAT Rx data of motor driver by index. | slave_num: int |
dict |
예시로 모터 드라이버의 Tx 및 Rx 데이터를 다음과 같이 얻을 수 있습니다.
1 2 3 4 |
|
출력
1 2 |
|
Moby 상태 데이터 얻기
Command | Description | Parameters | Return Type |
---|---|---|---|
get_moby_state() |
Get the current state of the Moby | - | dict |
get_moby_error_state() |
Get the error state of the Moby | - | str |
예시로 Moby의 상태와 에러상태를 다음과 같이 얻을 수 있습니다.
1 2 3 4 5 |
|
출력
1 2 3 |
|
에러 유형은 다음과 같습니다.
- NONE
- HW_EMG_PUSH
- HW_CONNECTION_LOST
- ECAT_MASTER_NOT_OP
- ECAT_SLAVE_NOT_OP
- ECAT_MOTOR_NOT_SERVO_ON
- ECAT_MOTOR_ERROR
- ECAT_SYSTEM_NOT_READY
- ECAT_ENCODER1_ERROR
- ECAT_ENCODER2_ERROR
- ECAT_ENCODER3_ERROR
- ECAT_ENCODER4_ERROR
- SW_POSITION_LIMIT
- SW_TORQUE_LIMIT
오도메트리와 로봇 역학 데이터
Command | Description | Parameters | Return Type |
---|---|---|---|
get_moby_pose() |
Get the Moby pose including position and orientation. | None | list |
get_moby_vel() |
Get the Moby velocity including linear and angular velocities. | None | list |
reset_moby_pose() |
Reset the Moby pose to its initial state. | None | None |
get_rotation_angle() |
Get the Moby's rotation angle. | None | dict |
get_drive_speed() |
Get the drive speed of Moby. | None | list |
get_target_vel() |
Get the target velocity of Moby. | None | list |
get_zero() |
Get the zero point of Moby. | None | dict |
사용 예시는 다음과 같습니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Output:
1 2 3 4 5 6 7 8 9 10 11 |
|
이 예시에서 Odometry 및 Physical 데이터는 얻는 것을 보여주며, Pose는 reset_moby_pose()
함수를 사용하여 초기 상태로 재설정 할 수 있습니다.
센서 값 획득
Command | Description | Parameters | Return Type |
---|---|---|---|
get_gyro_data() |
Get the gyroscope data. Heading angle and angular velocity as [rad] and [rad/s] units | None | dict |
reset_gyro() |
Reset the gyroscope data | None | None |
get_imu_data() |
Get the Inertial Measurement Unit (IMU) data. Angle, angular velocity, linear acceleration | None | [list, list, list] |
get_ir_data() |
Get the Infrared (IR) sensor data | None | dict |
get_bms() |
Get the Battery Management System (BMS) data | None | dict |
사용 예시는 다음과 같습니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Output:
1 2 3 4 5 6 7 8 9 10 11 |
|
이 예제에서 gyro_data, imu_data, ir_data 및 bms_data 변수는 각각 자이로스코프, IMU, 적외선 센서 및 BMS에서 데이터를 저장합니다. 딕셔너리의 키를 사용하여 특정 값을 액세스할 수 있습니다. 예를 들어, IMU 데이터의 x축 각도 값을 액세스하려면 imu_data[0][0]을 사용하면 됩니다.
이 예제는 센서 데이터 딕셔너리에서 특정 값을 액세스하고 출력하는 방법을 보여줍니다.
Moby 모션 커맨드
Command | Description | Parameters |
---|---|---|
stop_motion() |
Stops all motion of Moby. | None |
set_target_velocity(vx: float, vy: float, vw: float) |
Sets the target linear and angular velocities for Moby. | vx: float vy: float vw: float |
move_rotation_deg(fl: float, fr: float, bl: float, br: float) |
Rotates each wheel of Moby by specified angles in degrees. | fl: float fr: float bl: float br: float |
move_driving_mps(fl: float, fr: float, bl: float, br: float) |
Drives each wheel of Moby at specified speeds in meters per second. | fl: float fr: float bl: float br: float |
사용 예시는 다음과 같습니다.
1 2 3 4 5 6 7 8 9 10 11 |
|
상기 예제는 Moby 모션 명령을 사용하여 로봇의 움직임을 제어하는 방법을 보여줍니다.