3 Use and Development

This section mainly introduces the basic operation and use of the BUNKERPRO platform, and how to carry out the secondary development of the vehicle body through the external CAN interface and the CAN

This section mainly introduces the basic operation and use of the BUNKERPRO platform, and how to carry out the secondary development of the vehicle body through the external CAN interface and the CAN bus protocol.

3.1 Use and operation

Check

•Check the condition of the vehicle body. Check if the vehicle body has obvious abnormalities; if so, please contact after-sales support;

•When using for the first time, confirm whether Q2 (power switch) in the rear electrical panel is pressed; if it is not pressed, please press it and release it, then it is in the released state.

Startup

•Press the power switch (Q2 in the electrical panel); under normal circumstances, the light of the power switch will light up, and the voltmeter will display the battery voltage normally;

•Check the battery voltage. If the voltage is greater than 48V, it means the battery voltage is normal. If the voltage is lower than 48V, please charge; when the voltage is lower than 46V, BUNKERPRO cannot move normally.

Shutdown

•Press the power switch to cut off the power;

Basic operating procedures of remote control:

•After starting the BUNKERPRO robot chassis normally, start the remote control and select the remote control mode to control the movement of the BUNKER PRO platform through the remote control.

3.2 Charging

BUNKERPRO is equipped with a standard charger by default, which can meet the charging needs of customers. The specific operating procedures of charging are as follows:

Make sure that the BUNKERPRO chassis is in a shutdown state. Before charging, please make sure that Q2 (power switch) in the rear electrical console is turned off; insert the plug of the charger into the Q3 charging interface in the rear electrical control panel;

Connect the charger to the power supply and turn on the charger switch to enter the charging state.

When charging by default, there is no indicator light on the chassis. Whether it is charging or not depends on the status indicator of the charger.

3.3 Development

BUNKERPRO provides a CAN interface for the user's development, and the user can control the vehicle body through this interface.

The CAN communication standard in BUNKERPRO adopts the CAN2.0B standard; the communication baud rate is 500K, and the message format adopts the MOTOROLA format. The linear velocity of the movement and the angular velocity of the rotation of the chassis can be controlled through the external CAN bus interface; BUNKERPRO will feedback the current movement status information and the status information of the BUNKERPRO chassis in real time.

The protocol includes system status feedback frame, movement control feedback frame, and control frame. The content of the protocol is as follows:

The system status feedback command includes the current vehicle body status feedback, control mode status feedback, battery voltage feedback, and fault feedback. The content of the protocol is shown in Table 3.1.

Table 3.1 Feedback Frame of BUNKERPRO Chassis System Status

Table 3.2 Description of Fault Information

Description of Fault Information

Byte

Bit

Meaning

bit [0]

Battery undervoltage fault

bit [1]

Battery undervoltage warning

bit [2]

Remote control disconnection protection (0: normal, 1: remote control disconnection)

byte [5]

bit [3]

No.1 motor communication failure (0: No failure 1: Failure)

bit [4]

No.2 motor communication failure (0: No failure 1: Failure)

bit [5]

Reserved, default 0

bit [6]

Reserved, default 0

bit [7]

Reserved, default 0

The command of movement control feedback frame includes the feedback of current linear velocity and angular velocity of moving vehicle body. The specific protocol content is shown in Table 3.3.

Table 3.3 Movement Control Feedback Frame

Command Name
Movement Control Feedback Command

Sending node

Receiving node

ID

Cycle(ms) Receive time- out(ms)

Steer-by- wire chassis

Decision-making control unit

0x221

20ms (None)

Data length

0x08

Position

Function

Data type

Description

byte [0]

byte [1]

The movement speed is 8 bits higher

The movement speed is 8 bits lower

signed int16

Actual speed × 1000 (with an accuracy of 0.001m/s)

byte [2]

byte [3]

The rotation speed is 8 bits higher

The rotation speed is 8 bits lower

signed int16

Actual speed × 1000 (with an accuracy of 0.001rad/s)

byte [4]

Reserved

-

0x00

byte [5]

Reserved

-

0x00

byte [6]

Reserved

-

0x00

byte [7]

Reserved

-

0x00

The control frame includes linear velocity control opening, angular velocity control opening and check sum. The specific content of the protocol is shown in Table 3.4.

Table 3.4 Movement Control Frame

Command Name
Control Mode

Sending node

Receiving node

ID

Cycle(ms) Receive time-out(ms)

Decision- making control unit

Chassis node

0x111

20ms (None)

Data length

0x08

Position

Function

Data type

Description

byte [0]

byte [1]

The linear velocity is eight bits higher

The linear velocity is eight bits lowe

signed int16

Moving speed of vehicle body , unit: mm/s, range [-1700,1700]

byte [2]

byte [3]

The angular velocity is eight bits higher

The angular velocity is eight bits lower

signed int16

Angular velocity of vehicle body rotation, unit: 0.001rad/s, range [- 3140,3140]

byte [4]

Reserved

-

0x00

byte [5]

Reserved

-

0x00

byte [6]

Reserved

-

0x00

byte [7]

Reserved

-

0x00

The mode setting frame is used to set the control interface of the terminal. The specific protocol content is shown in Table 3.5

Table 3.5 Control Mode Setting Frame

Command Name
Control Mode Setting Command

Sending node

Receiving node

ID

Cycle(ms) Receive time-out(ms)

Decision-making control unit

Chassis node

0x421

20ms 500ms

Data length

0x01

Position

Function

Data type

Description

byte [0]

CAN control enable

unsigned int8

0x00 Standby mode 0x01 CAN command mode enable

Note [1] Description of control mode

When the remote control of BUNKERPRO is not powered on, the control mode is standby mode by default, and you need to switch it to command mode to send movement control command. If the remote control is turned on, the remote control has the highest authority and can shield the control of commands. When the remote control is switched to the command mode, it still needs to send the control mode setting command before responding to the speed command.

The status setting frame is used to clear system errors. The specific protocol content is shown in Table 3.6.

Table 3.6 Status Setting Frame

Command Name
Status Setting Command

Sending node

Receiving node

ID

Cycle (ms) Receive time-out

Decision-making control unit

Chassis node

0x441

None None

Data length

0x01

Position

Function

Data type

Description

byte [0]

Error clearing command

unsigned int8

0x00 clear all errors 0x01 Clear motor 1’s error 0x02 Clear motor 2’s error

Note 3: Sample data; the following data is for testing purposes only

1.The vehicle advances at a speed of 0.15/S

byte [0]
byte [1]
byte [2]
byte [3]
byte [4]
byte [5]
byte [6]
byte [7]

0x00

0x00

0x00

0x00

0x00

0x00

0x00

0x00

2.The vehicle rotates at 0.2RAD/S

byte [0]
byte [1]
byte [2]
byte [3]
byte [4]
byte [5]
byte [6]
byte [7]

0x00

0x00

0x00

0x00

0x00

0x00

0x00

0x00

In addition to the chassis status information will be fed back, the chassis feedback information also includes motor data and sensor data.

Table 3.7 Motor Speed Current Position Information Feedback

Command Name
Motor Drive High Speed Information Feedback Frame

Sending node

Receiving node

ID

Cycle (ms) Receive time- out(ms)

Steer-by- wire chassis

Decision- making control unit

0x251~0x254

20ms None

Data length

0x08

Position

Function

Data type

Description

byte [0]

byte [1]

The motor speed is 8 bits higher

The motor speed is 8 bits lower

signed int16

Current motor speed Unit RPM

byte [2]

Reserved

-

0x00

byte [3]

The drive temperature is 8 bits lower

-

Unit 1℃

byte [4]

Reserved

-

0x00

byte [5]

Drive status

-

See Table 3.9 for details

byte [6]

Reserved

-

0x00

byte [7]

Reserved

-

0x00

Table 3.8 Motor Temperature, Voltage and Status Information Feedback

Command Name
Motor Drive Low Speed Information Feedback Frame

Sending node

Receiving node

ID

Cycle(ms) Receive time-out(ms)

Steer-by- wire chassis

Decision- making control unit

0x261~0x264

None None

Data length

0x08

Position

Function

Data type

Description

byte [0]

byte [1]

Reserved

Reserved

-

-

0x00

0x00

byte [2]

byte [3]

The drive temperature is 8 bits higher

The drive temperature is 8 bits lower

signed int16

Unit 1℃

byte [4]

Reserved

-

0x00

byte [5]

Drive status

unsigned int8

See Table 3.9 for details

byte [6]

Reserved

-

0x00

byte [7]

Reserved

-

0x00

Table 3.9 Drive Status

Byte
Bit
Description

bit [0]

Whether the power supply voltage is too low (0:Normal 1:Too low)

bit [1]

Whether the motor is overheated (0: Normal 1: Overheated)

bit [2]

Reserved

bit [3]

Reserved

byte [5]

bit [4]

Reserved

bit [5]

Reserved

bit [6]

Reserved

bit [7]

Reserved

Table 3.10 Odometer Feedback Frame

Comman d Name
Odometer Information Feedback Frame

Sending node

Receiving node

ID

Cycle(ms) Receive time- out(ms)

Steer-by- wire chassis

Decision-making control unit

0x311

20ms (None)

Data length

0x08

Position

Function

Data type

Description

byte [0]

byte [1]

byte [2]

byte [3]

Highest bit of left wheel odometer

Second-highest bit of left wheel odometer

Second-lowest bit of left wheel odometer

Lowest bit of left wheel odometer

signed int32

Chassis left wheel odometer feedback Unit: mm

byte [4]

byte [5]

byte [6]

byte [7]

Highest bit of right wheel odometer

Second-highest bit of right wheel odometer

Second-lowest bit of right wheel odometer

Lowest bit of right wheel odometer

signed int32

Chassis right wheel odometer feedback Unit: mm

Table 3.11 Remote Control Information Feedback

Command Name
Remote Control Information Feedback Frame

Sending node

Receiving node

ID

Cycle(ms) Receive time-out (ms)

Steer-by- wire chassis

Decision-making control unit

0x241

20ms (Non)e

Data length

0x08

Position

Function

Data type

Description

byte [0]

Remote control SW feedback

unsigned int8

bit[0-1]: SWA: 2-Up 3-Down bit[2-3]: SWB: 2-Up 1-Middle 3-Down bit[4-5]: SWC: 2-Up 1-Middle 3-Down bit[6-7]: SWD: 2-Up 3-Down

byte [1]

Right lever left and right

signed int8

Range: [-100,100]

byte [2]

Right lever up and down

signed int8

Range: [-100,100]

byte [3]

Left lever up and down

signed int8

Range: [-100,100]

byte [4]

Left lever left and right

signed int8

Range: [-100,100]

byte [5]

Left knob VRA

signed int8

Range: [-100,100]

byte [6]

Reserved

--

0x00

byte [7]

Count check

unsigned int8

0-255 cycle count

3.3.2 CAN cable connection

BUNKERPRO is shipped with a aviation plug male connector as shown in Figure 3.2. The definition of the cable: yellow is CANH, blue is CANL, red is power positive, and black is power negative. Note: In the current BUNKERPRO version, the external extension interface is only open to the rear interface. In this version, the power supply can provide a maximum current of 10A.

3.3.3 Realization of CAN command control

Start the BUNKERPRO mobile robot chassis normally, turn on the FS remote control, and then switch the control mode to command control, that is, turn the SWB mode selection of the FS remote control to the top. At this time, the BUNKERPRO chassis will accept the command from the CAN interface, and the host can also analyze the current status of the chassis through the real-time data fed back by the CAN bus at the same time. Refer to CAN communication protocol for specific protocol content.

3.4 Firmware upgrade (not open yet)

In order to facilitate users to upgrade the firmware version used by BUNKERPRO and bring customers a more complete experience, BUNKERPRO is provided with a hardware interface for firmware upgrade and corresponding client software. The client interface is shown in Figure 3.3.

Upgrade preparation

•Serial cable X 1

•USB to serial port X 1

•BUNKERPRO chassis X 1

•Computer (WINDOWS operating system) X 1

Firmware upgrade software

Upgrade preparation

•Ensure that the power supply of the robot chassis is disconnected before connecting;

•Use the serial cable to connect to the BUNKERPRO chassis upgrade serial port (requires disassembly of the rear electrical board); connect the serial cable to the computer;

•Open the client software;

•Select the port number;

•Power on the UNKERPRO chassis and click "Start Connection" immediately (the chassis will wait 3S before powering on; if the time exceeds 6S, it will enter the application); if the connection is successful, the text box will prompt "Connected successfully";

•Load Bin file;

•Click the Upgrade button, and wait for the prompt of upgrade completion;

•Disconnect the serial cable, power off the chassis, and power on again.

3.5 BUNKERPRO ROS Package Use Example

ROS provides some standard operating system services, such as hardware abstraction, low-level equipment control, implementation of common functions, inter-process message and data packet management. ROS is based on a graph architecture, so that processes of different nodes can receive, release, and aggregate various information (such as sensing, control, status, planning, etc.). Currently ROS mainly supports UBUNTU.

Development preparation

Hardware preparation

•CANlight can communication module X1

•Thinkpad E470 notebook X1 AGILEX BUNKERPRO mobile robot chassis X1

•AGILEX BUNKERPRO supporting remote control FS-i6s X1

•AGILEX BUNKERPRO top aviation socket X1

Use example environment description

•Ubuntu 16.04 LTS(This is a test version, tested on Ubuntu 18.04 LTS)

•ROS Kinetic(Subsequent versions are also tested)

•Git

Hardware connection and preparation

•Lead out the CAN cable of the BUNKERPRO top aviation plug or the tail plug, and connect CAN_H and CAN_L in the CAN cable to the CAN_TO_USB adapter respectively; •Turn on the knob switch on the BUNKERPRO mobile robot chassis, and check whether the emergency stop switches on both sides are released;

•Connect the CAN_TO_USB to the usb interface of the notebook. The connection diagram is shown in Figure 3.4.

ROS installation and environment setting

For installation details, please refer to http://wiki.ros.org/KINETIC/INSTALLATION/UBUNTU

Test CANABLE hardware and CAN communication

Set CAN-TO-USB adaptor

•Enable gs_usb kernel module

$ sudo modprobe gs_usb

•Set 500k baud rate and enable can-to-usb adaptor

$ sudo ip link set can0 up type can bitrate 500000

•If no error occurred in the previous steps, you should be able to use the command to view the can equipment immediately

$ ifconfig -a

•Install and use can-utils to test hardware

$ sudo apt install can-utils

•If the can-to-usb has been connected to the BUNKERPRO robot this time, and the vehicle has been turned on, use the following commands to monitor the data from the BUNKERPRO chassis

$ candump can0

•Reference sources:

[1]https://github.com/agilexrobotics/agx_sdk [2]https://wiki.rdu.im/_pages/Notes/Embed%02ded-System/Linux/can-bus-in-linux.html

AGILEX BUNKERPRO ROS PACKAGE download and compile

•Download ros dependent package

$ sudo apt install ros-$ROS_DISTRO-teleop-twist-keyboard

$ sudo apt install libasio-dev

•Clone and compile bunker_ros source code

$ cd ~/catkin_ws/src

$ git clone https://github.com/agilexrobotics/ugv_sdk.git

$ git clone https://github.com/agilexrobotics/bunker_ros.git

$ cd ..

$ catkin_make

Reference source:https://github.com/agilexrobotics/bunker_ros

Start the ROS nodes

•Start the base node

$ roslaunch bunker_bringup bunker_minimal.launch

•Start the keyboard remote operation node

$ roslaunch bunker_bringup bunker_teleop_keyboard.launch

Last updated