From 1fb5b018087b7415939048336dbeac8fb5270993 Mon Sep 17 00:00:00 2001 From: Ruixiang Du Date: Thu, 22 Oct 2020 16:25:36 +0800 Subject: [PATCH] updated readme --- README.md | 113 ++++++++++++++++++++++++------------------------------ 1 file changed, 51 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 01b9177..5d2185a 100755 --- a/README.md +++ b/README.md @@ -7,57 +7,25 @@ Copyright (c) 2020 [WestonRobot](https://www.westonrobot.com/) ## Introduction -Supported platforms +This software package provides a C++ interface to communicate with the mobile platforms from Weston Robot, for sending commands to the robot and receiving the latest robot state. + +Supported robot platforms * **Scout**: skid-steer mobile base * **Hunter**: ackermann mobile base -This software packages provides a C++ interface to communicate with the mobile platforms from Weston Robot, for sending commands to the robot and acquiring the latest robot state. The SDK works on both x86 and ARM platforms. +Supported environments + +* **Architecture**: x86_64/arm64 +* **OS**: Ubuntu 16.04/18.04/20.04 +* **ROS**: Kinetic/Melodic/Noetic + +It should also work in other similar Linux environments but only the listed setups are regularly tested. Generally, you only need to instantiate an object of the robot base class (such as ScoutBase), then use the object to programmatically control the robot. Internally, the base class manages two background threads, one to process CAN/UART messages of the robot state and accordingly update state variables in the robot state data structure, and the other to maintain a 50Hz loop and send the latest command to the robot base. User can iteratively perform tasks in the main thread and check the robot state or set control commands. Refer to "src/apps" for examples. -## Hardware Interface - -### Setup CAN-To-USB adapter - -1. Enable gs_usb kernel module - ``` - $ sudo modprobe gs_usb - ``` -2. Bringup can device - ``` - $ sudo ip link set can0 up type can bitrate 500000 - ``` -3. If no error occured during the previous steps, you should be able to see the can device now by using command - ``` - $ ifconfig -a - ``` -4. Install and use can-utils to test the hardware - ``` - $ sudo apt install can-utils - ``` -5. Testing command - ``` - # receiving data from can0 - $ candump can0 - # send data to can0 - $ cansend can0 001#1122334455667788 - ``` - -Two scripts inside the "./scripts" folder are provided for easy setup. You can run "./setup_can2usb.bash" for the first-time setup and run "./bringup_can2usb.bash" to bring up the device each time you unplug and re-plug the adapter. - -### Setup UART - -Generally your UART2USB cable should be automatically recognized as "/dev/ttyUSB0" or something similar and ready for use. If you get the error "... permission denied ..." when trying to open the port, you need to grant access of the port to your user accout: - -``` -$ sudo usermod -a -G dialout $USER -``` - -You need to re-login to get the change to take effect. - ## Build SDK ### Install dependent libraries @@ -122,6 +90,47 @@ $ cmake .. $ make ``` +## Hardware Interface + +### Setup CAN-To-USB adapter + +1. Enable gs_usb kernel module + ``` + $ sudo modprobe gs_usb + ``` +2. Bringup can device + ``` + $ sudo ip link set can0 up type can bitrate 500000 + ``` +3. If no error occured during the previous steps, you should be able to see the can device now by using command + ``` + $ ifconfig -a + ``` +4. Install and use can-utils to test the hardware + ``` + $ sudo apt install can-utils + ``` +5. Testing command + ``` + # receiving data from can0 + $ candump can0 + # send data to can0 + $ cansend can0 001#1122334455667788 + ``` + +Two scripts inside the "./scripts" folder are provided for easy setup. You can run "./setup_can2usb.bash" for the first-time setup and run "./bringup_can2usb.bash" to bring up the device each time you unplug and re-plug the adapter. + +### Setup UART + +Generally your UART2USB cable should be automatically recognized as "/dev/ttyUSB0" or something similar and ready for use. If you get the error "... permission denied ..." when trying to open the port, you need to grant access of the port to your user accout: + +``` +$ sudo usermod -a -G dialout $USER +``` + +You need to re-login to get the change to take effect. + + ## Run Demo Apps The demo code expects one parameter for the CAN bus mode. @@ -150,26 +159,6 @@ $./app_scout_monitor /dev/ttyUSB0 115200 Note: the monitor app is not built by default if you use this SDK with ROS. -## Known Limitations - - - ## Reference * [CAN command reference in Linux](https://wiki.rdu.im/_pages/Notes/Embedded-System/Linux/can-bus-in-linux.html)