Page tree
Skip to end of metadata
Go to start of metadata



Slamware Console是配套Slamware解决方案使用的一个命令行开发工具。这个工具的主要用途是调试您底盘的Control Bus协议实现是否正确。同时也可以用来诊断您的底盘上的各个传感器的状态,以及里程计和轮子的数据。





用法简介

格式

slamware_console base [options] <command> [cmd_arguments]

可用选项

选项名称

简写

描述

备注

--channel
-c channel

The communication channel with the base, supported channels: serial, tcp

 

--help
-h help

Show this message

 

--port
-p port

Trace communication between host and base

 

--trace-comm
-t trace comm

Trace communication between host and base

 

--version
-v print version number

Print version number

 

--host
host

The host used to communicate with the base (required for tcp channel)

 

命令概览

命令名称

描述

备注

beacon

Read auto home IR beacon data

 

bumper

Read bumper, cliff sensor data

 

config

Read configuration from base

 

event

Send Event Cmd

 

monitor

Continiously read sensor data and output to the console

 

motor

Read motor information, such as wheels' odometry

 

poll

Poll Base Cmd

 

run

Make motor run

 

sensor

Read distance sensors' data, such as ultrasonic data

 

status

Read base status, such as battery, charging status and etc.

 

test

Test base control bus protocol

 

vrun

Vector run. vrun <vx> <vy> <omega> <time>. Units: m/s m/s rad/s s

 

返回顶部


命令用法及代码示例

如下所有代码示例使用的接口假设为COM3

BEACON

读取自动返回充电时红外灯塔数据。

代码示例

slamware_console.exe base -c serial -p COM3 beacon
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 beacon
[rp.slamware.test.SlamwareConsoleApplication][INFO] Slamware Console 1.7.0
[rp.slamware.utils.ChannelFactory] [INFO]Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO] Firmware Version: 1.83
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO] Serial Number: C47DDDC6F19575BD90AB43C0
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO] Found 3 beacons and 3 probes
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO]   Probe #0: 0:     1:    2:     
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO]   Probe #1: 0:     1:    2:     
[rp.slamware.test.SlamwareBaseConsoleApplication][INFO]   Probe #2: 0:     1:    2:     
[rp.slamware.test.SlamwareConsoleApplication][INFO] Successfully executed command

返回顶部

BUMPER

读取碰撞传感器数据。

代码示例

slamware_console.exe base -c serial -p COM3 bumper
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 bumper
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Bumper/Cliff Values:
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        [ ] #0   X:12.7 cm Y:10.5 mm Z:-5.0 mm Yaw:40.0deg
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        [ ] #2   X:16.5 cm Y:0.0  mm Z:-5.0 mm Yaw:0.0deg
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

返回顶部

CONFIG

读取底盘配置参数。

代码示例

slamware_console.exe base -c serial -p COM3 config
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 config
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Parsed JSON:
{
   "base" : {
      "hardware_version" : 1,
      "high_battery_percentage_for_charging" : 0.6999999880790710,
      "low_battery_auto_homing" : true,
      "low_battery_percentage_for_charging" : 0.3000000119209290,
      "manufacture_id" : 255,
      "manufacture_name" : "Slamtec",
      "model_id" : 4096,
      "model_name" : "Slamware SDP",
      "robot_size" : 0.3300000131130219,
      "sensors" : [
         {
            "id" : 0,
            "installation_pose" : {
               "x" : 0.1270000040531158,
               "y" : 0.1049999967217445,
               "yaw" : 0.6981316804885864,
               "z" : -0.05000000074505806
            },
            "type" : "bumper"
         },
         {
            "id" : 1,
            "installation_pose" : {
               "x" : 0.1199999973177910,
               "y" : 0.1000000014901161,
               "yaw" : 0.6981316804885864,
               "z" : 0.05000000074505806
            },
            "type" : "sonar"
         },
      ]
   },
   "features" : {
      "has_ir_docking_tower" : false
   },
   "lidar" : {
      "installation_pose" : {
         "x" : 0.1099999994039536,
         "yaw" : 3.141592741012573
      }
   },
   "motion_plan" : {
      "bump_handle_strategy" : "default",
      "side_margin" : 0.1000000014901161
   }
}

[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Base Info
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Manufacture: Slamtec (00FF)
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Model: Slamware SDP (1000)
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Hardware Version: 1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Robot Diameter: 33.0 cm
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Lidar
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Installation Pose: 11.0 cm,  0.0 cm, 180.0 deg
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Sensors: 6 sensors
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Sensor #0: Bumper at (12.7 cm, 10.5 cm, 40.0 deg)
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Sensor #1: Sonar at (12.0 cm, 10.0 cm, 40.0 deg)
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Motion Planning
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Side Margin: 10.0 cm
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Bumper Policy: default
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Features
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]     Has IR Tower: No
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

返回顶部

EVENT

发送event代码至底盘。

代码示例

slamware_console.exe base -c serial -p COM3 event 97
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 event 97
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

Note:

event参数需为十进制格式,上述代码示例中event 97即为0X61的十进制格式。

当前支持的事件代码如下:

系统事件代码

十进制格式

命令名称

描述

0x61

97

LIDAR_CONN_FAIL

LIDAR连接失败

0x62

98

LIDAR_RAMPUP_FAIL

LIDAR启动失败

0x63

99

SYSTEM_UP_OK

系统启动成功

0x64

100

FIRMWARE_UPDATE

系统固件升级

0x65

101

CORE_DISCONNECT

系统断开连接

0x66

102

FIRMWARE_UPDATE_OK

固件升级成功

0x80

128

START_SWEEP

通知外部系统清扫开始(仅针对扫地机版本)

0x81

129

END_SWEEP

通知外部系统清扫结束(仅针对扫地机版本)

返回顶部

MONITOR

连续读取sensor数据并在终端显示。

1. 读取motor数据

代码示例

slamware_console.exe base -c serial -p COM3 monitor motor
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 monitor motor
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Left Wheel: 0.0     mm Right Wheel: 0.0     mm
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Left Wheel: 0.0     mm Right Wheel: 0.0     mm

2. 读取bumper/cliff数据

代码示例

slamware_console.exe base -c serial -p COM3 monitor bumper
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 monitor bumper
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Bumper/Cliff Values:
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        [ ] #0   X:12.7 cm Y:10.5 mm Z:-5.0 mm Yaw:40.0deg
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        [ ] #1   X:12.7 cm Y:-10.5mm Z:-5.0 mm Yaw:320.0deg
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        [ ] #2   X:16.5 cm Y:0.0  mm Z:-5.0 mm Yaw:0.0deg

3. 读取sonar数据

代码示例

slamware_console.exe base -c serial -p COM3 monitor sensor
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 monitor sensor
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Sensor Values:
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        3 : 127.0mm
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        4 : 0.0  mm

返回顶部

MOTOR

读取里程计数据。

代码示例

slamware_console.exe base -c serial -p COM3 motor
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 motor
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Left Wheel: 0.0     mm Right Wheel: 0.0     mm
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

返回顶部

POLL

查询外部系统命令。

代码示例

slamware_console_tool>slamware_console.exe base -c serial -p COM3 poll
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 poll
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 2.0.0_dev
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:..\.\COM4...
[rp.slamware.utils.ChannelFactory] [DBUG] Channel established
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:..\.\COM4
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: zeus base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 1.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 2.2
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47EDDC6F19575BD90AB41E9
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Base cmd pending: ff
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

当前支持的外部系统命令如下:

外部系统命令代码

命令名称

描述

0x51

GET_INFO

获取SLAMWARE CORE系统信息,包含软硬件版本,网络配置

0x52

RESET_WIFI

重置SLAMWARE CORE无线网络

0x53

FW_UPGRADING

更新SLAMWARE CORE固件

0x80

START_SWEEP

开始清扫(仅针对扫地机版本)

0x81

STOP_SWEEP

结束清扫(仅针对扫地机版本)

0x82

SPOT_SWEEP

定点清扫(仅针对扫地机版本)

0x90

GET_HEALTH

获取健康状况

0xA0

MOVE_FORWARD

向前

0xA1

MOVE_BACKWARD

向 后

0xA2

TURN_LEFT

向左

0xA3

TURN_RIGHT

向右

0xAF

CANCEL_ACTION

取消上一步操作

返回顶部

RUN

控制电机运动。

参数:

参数名称单位备注
左轮速度mm/s
右轮速度mm/s
运行时间s

Note:

此命令仅限于两轮差动电机。

测试电机是否正常运行,请参考如下步骤:

1.run 50 50 5

将速度设置为50时,电机能正常响应;

2.run 100 100 5

将速度设置为100时,电机能平稳行驶;

3. 测试里程计是否准确

  • run 300 300 5
    返回值为pose(x方向位移,Y方向位移,偏移角度),单位是分别为mm, mm, degree。
    注:X方向正向为机器人前进方向;Y方向正向为机器人左侧;角度为以X方向为0,逆时针方向的偏移角度。
    比较从初始位置pose(0,0,0)到终止位置之间的反馈值与实际测量值之间的误差。
    例如如下代码中,终止位置为pose(1302.15056, 190.48846, 6.8deg)
    [rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] dl= 5.00000 dr=5.00000 pose:(1297.28958, 189.31762,  6.8deg) ->(1302.15056, 190.48846, 6.8deg)
  • run 300 0 5
    仅左轮转动(即机器人顺时针旋转得到的夹角),并测试差值。
  • run 0 300 5

          仅右轮转动(即机器人逆时针旋转夹角),并测试差值。

Note:

误差不可超过5%,否则机器人导航误差较大且行为异常。

代码示例

slamware_console.exe base -c serial -p COM3 run 100 100 5
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 run 100 100 5
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] dl= 0.00000 dr=40.00000 pose:( 0.00000,  0.00000,   0.0deg)->(20.00000,  0.00000,   6.9deg)
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] dl= 0.00000 dr=40.00000 pose:(20.00000,  0.00000,   6.9deg)->(39.41518,  4.80113,  13.9deg)

返回顶部

SENSOR

读取聚力传感器(如超声波传感器)数据。

代码示例

slamware_console.exe base -c serial -p COM3 sensor
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 sensor
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Sensor Values:
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        3 : 125.0mm
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        4 : 0.0  mm
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO]        5 : 878.0mm
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

返回顶部

STATUS

读取底盘信息状态。

代码示例

slamware_console.exe base -c serial -p COM3 status
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 status
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Battery: 67%
[rp.slamware.test.SlamwareBaseConsoleApplication] [WARN] Charging Status: Charging (you are using legacy protocol, please specify DcConnected or OnChargingBase bit field
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Successfully executed command

返回顶部

TEST

测试底盘设置信息。

代码示例

C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 test
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test] [INFO] Test Fixture: ControlBus
[rp.slamware.test] [INFO]       Testing connect...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing getConfig...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing getStatus...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing getMotorData...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing getSensorData...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing getBumperData...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing getAutoHomeData...
[rp.slamware.test] [ERRO]               fail: (int)dev_->getAutoHomeData(req, (uint8_t*)&response, &responseSize)==(int)RESULT_OK: actual -2147450876 != 0
[rp.slamware.test] [INFO]       Testing setMotor...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [INFO]       Testing sendEvent...
[rp.slamware.test] [INFO]               pass
[rp.slamware.test] [ERRO] ControlBus: 9 total, 0 skipped, 8 pass, 1 failed
[rp.slamware.test.SlamwareConsoleApplication] [ERRO] Execute command failed: 00000001

返回顶部

VRUN

控制电机运动。

参数:

参数名称单位备注
X方向速度m/s
Y方向速度m/s
角速度rad/s
时间s

Note:

此命令适用于三轮全向轮及两轮差动电机。

测试电机是否正常运行,请参考如下步骤:

1.vrun 0.05 0 0 5

将机器人前进速度设置为 0.05 m/s 时,电机能正常响应;

2. vrun 0.1 0 0 5

将机器人前进速度设置为0.1 m/s时,电机能平稳行驶;

3. 测试里程计是否准确

  • vrun 0.3 0 0 5

返回值为pose(x方向位移,Y方向位移,偏移角度),单位是分别为mm, mm, degree。
注:X方向正向为机器人前进方向;Y方向正向为机器人左侧;角度为以X方向为0,逆时针方向的偏移角度。
比较从初始位置pose(0,0,0)到终止位置之间的反馈值与实际测量值之间的误差。
例如如下代码中,终止位置为pose(1302.15056, 190.48846, 6.8deg)

[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] dl= 5.00000 dr=5.00000 pose:(1297.28958, 189.31762,  6.8deg) ->(1302.15056, 190.48846, 6.8deg)
  • vrun 0 0 1 5

          机器人逆时针旋转夹角,并测试差值。

  • vrun 0 0 -1 5

          机器人顺时针旋转夹角,并测试差值。

Note:

误差不可超过5%,否则机器人导航误差较大且行为异常。

代码示例

slamware_console.exe base -c serial -p COM3 vrun 0.1 0.1 0 5
C:\Users\LW\Desktop\tools\slamware_console_tool>slamware_console.exe base -c serial -p COM3 vrun 0.1 0.1 0 5
[rp.slamware.test.SlamwareConsoleApplication] [INFO] Slamware Console 1.9.0_rc1
[rp.slamware.utils.ChannelFactory] [INFO] Connecting to serial:COM3...
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Connected to Control Bus Device at serial:COM3
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Model: ref base
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Firmware Version: 0.90
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Hardware version: 0.1
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] Serial Number: C47BDDC1F79072BD90B041C7
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] dx= 0.00023 dy=201.64026 dtheta=201.7deg pose:( 0.00000,  0.00000,   0.0deg)->( 0.00023, 201.64026, 201.7deg)
[rp.slamware.test.SlamwareBaseConsoleApplication] [INFO] dx= 0.00023 dy=201.64026 dtheta=201.7deg pose:( 0.00023, 201.64026, 201.7deg)->(74.40319, 14.22896, 403.3deg)

返回顶部