3 Development Guide
Last updated
Last updated
Robot Operating System (ROS or ros) is an open source robotics middleware suite. Although ROS is not an operating system but a collection of software frameworks for robot software development, it provides services designed for a heterogeneous computer cluster such as hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, and package management. Running sets of ROS-based processes are represented in a graph architecture where processing takes place in nodes that may receive, post and multiplex sensor data, control, state, planning, actuator, and other messages. Despite the importance of reactivity and low latency in robot control, ROS itself is not a real-time OS (RTOS). It is possible, however, to integrate ROS with real-time code. The lack of support for real-time systems has been addressed in the creation of ROS 2.0,a major revision of the ROS API which will take advantage of modern libraries and technologies for core ROS functionality and add support for real-time code and embedded hardware.
A node represents a single process running the ROS graph. Every node has a name, which it registers with the ROS master before it can take any other actions. Multiple nodes with different names can exist under different namespaces, or a node can be defined as anonymous, in which case it will randomly generate an additional identifier to add to its given name. Nodes are at the center of ROS programming, as most ROS client code is in the form of a ROS node which takes actions based on information received from other nodes, sends information to other nodes, or sends and receives requests for actions to and from other nodes.
ROS processes are represented as nodes in a graph structure, connected by edges called topics. ROS nodes can pass messages to one another through topics, make service calls to other nodes, provide a service for other nodes, or set or retrieve shared data from a communal database called the parameter server. A process called the ROS Master[66] makes all of this possible by registering nodes to itself, setting up node-to-node communication for topics, and controlling parameter server updates. Messages and service calls do not pass through the master, rather the master sets up peer-to-peer communication between all node processes after they register themselves with the master. This decentralized architecture lends itself well to robots, which often consist of a subset of networked computer hardware, and may communicate with off-board computers for heavy computation or commands.
Topics are named buses over which nodes send and receive messages. Topic names must be unique within their namespace as well. To send messages to a topic, a node must publish to said topic, while to receive messages it must subscribe. The publish/subscribe model is anonymous: no node knows which nodes are sending or receiving on a topic, only that it is sending/receiving on that topic. The types of messages passed on a topic vary widely and can be user-defined. The content of these messages can be sensor data, motor control commands, state information, actuator commands, or anything else.
A node may also advertise services. A service represents an action that a node can take which will have a single result. As such, services are often used for actions which have a defined beginning and end, such as capturing a single-frame image, rather than processing velocity commands to a wheel motor or odometer data from a wheel encoder. Nodes advertise services and call services from one another.
Similar to an operating system, ROS files are also organized on the hard disk in a particular fashion.
Package:The ROS packages are the most basic unit of the ROS software. It contains the ROS runtime process (nodes), libraries, configuration files, and so on, which are organized together as a single unit. Packages are the atomic build item and release item in the ROS software.
Package Manifest:The package manifest file is inside a package that contains information about the package, author, license, dependencies, compilation flags, and so on. The package.xml file inside the ROS package is the manifest file of that package.
Meta Package:The term meta package is used for a group of packages for a special purpose. In an older version of ROS such as Electric and Fuerte, it was called stacks, but later it was removed, as simplicity and meta packages came to existence. One of the examples of a meta package is the ROS navigation stack.
Hexagon key
SCOUT MINI Lite
When the product is ready for shipping, the sensor holder is separated from the Scout MINI. User need to use tool to set the sensor holder on the Scout MINI. Firstly, put the four slider nuts into the slide way each side on the Scout MINI , and then use the hexagonal tool to screw corresponding four screws on the holder to the platform. Please refer to the figure shown below.
SCOUT MINI Pro
When the product is ready for shipping, the sensor holder is separated from the Scout MINI. User need to use tool to set the sensor holder on the Scout MINI. Firstly, put the four slider nuts into the slide way each side on the Scout MINI , and then use the hexagonal tool to screw corresponding four screws on the holder to the platform. Please refer to the figure shown below.
SCOUT MINI Lite
Put the HD display into the display holder horizontally, as shown in the figure below. Then settle the display holder with screws and nylon posts to the holes on both sides.
SCOUT MINI Pro
Put the HD display into the display holder horizontally, as shown in the figure below. Then settle the display holder with screws and nylon posts to the holes on both sides.
Check whether any wiring harness connections are disconnected;
Please make sure to operate in a relatively open area without large area of water . The environment is relatively open and stable, there are no flammable, explosive and other dangerous goods aroundï¼›
The whole machine is complete, the wiring harness is intact and there is no break, and the sensors are not damaged.
This Kit is not provided with mouse and keyboard, users can purchase it based on requirement, and can be connected with the USB interface of the computing unit or the USB HUB.
Press the power button on the Scout MINI, as shown in the figure below.
After pressing the power button of the Scout MINI , the computing unit will automatically log in and show the following interface, the root authority password and system login password are agx.
If you need to shut down he system, do not press the power button directly because thel computing unit is running. Enter the command $poweroff in the terminal or click shut down of the drop-down menu, as shown in the figure below, wait until the display shows no signal input, then press the power button to shut down the system.
(Ubuntu,ROS,Gazebo,RVIZ)
Open the wireless network settings of the host computer, it shows that there are two signals from the router GL-AR750 (respectively), please connect to the 5G frequency band, the default password is goodlife
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo apt-get install ros-melodic-desktop-full
sudo rosdep in
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo modprobe gs_usb
sudo ip link set can0 up type can bitrate 500000
ifconfig -a
sudo apt install can-utils
#receiving data from can0
$ candump can0
#send data to can0
$ cansend can0 001#1122334455667788
scout_bringup: Start up the mobile base node.
scout_base: Control and monitor package based on ugv_sdk.
scout_description: scout_min URDF model, available for simulation of customized robots equipped with sensors.
scout_msgs:scout_mini message format definition.
realsense2_camera: Set up and start the depth camera function package, and you can use the rviz visualization tool to view color maps, depth maps, dense point clouds, etc.
ydlidar_ros: Start the EAI-G4 single-line lidar function package, and users can set some parameters of the radar according to specific application scenarios.
velodyne_driver: Processing raw point cloud data and laser data function package.
velodyne_laserscan: base on velodyne_driver package,Compress point cloud data,send /scan data.
velodyne_pointcloud: Start all the nodes of the VLP_16 lidar and start publishing various data.
velodyne_msgs: Define various data formats of VLP_16 lidar.
Move_base is the core algorithm of robot navigation path planning. It subscribes to the positioning data of lidar /scan, map, /odom mileage and amcl, and then uses the path planning plugin integrated into move_base. The global path planning plugin includes:
navfn: The older code version in ROS implements the dijkstra and A* global planning algorithms.
global_planner: Reimplemented Dijkstra and A* global planning algorithm, the improved version of navfn.
parrot_planner: A simple algorithm to achieve global path planning algorithm.
Partial path planning plugins include:
base_local_planner: Implemented two local planning algorithms, Trajectory Rollout and DWA.
dwa_local_planner: The DWA local planning algorithm is implemented which can be regarded as an improved version of base_local_planner.
ROS SLAM Algorithm:
gmapping:Lidar/scan data and odometer/odom data are required, using PF (Particle Filter).
hector :Based on the optimized algorithm (solving the least squares problem), the advantages and disadvantages: no odometer is required, but the radar frame rate requires a very high rate at 40Hz, and the estimated 6-degree-of-freedom pose can adapt to the situation of uneven air or ground. Initial value has a great influence on the result, so the radar frame rate is required to be higher.
Cartographer:The cumulative error is lower than the previous two algorithms, and it can naturally output the covariance matrix and the input term optimized by the back-end. Lower-cost radars can also have high performance.
Combining these several slam algorithms, the kit uses gmapping algorithm to create slam maps. The slam_gmapping node receives the sensor_msgs/LaserScan message and builds a map (nav_msgs/OccupancyGrid). The map can be viewed through ROS topic or service.
Gmapping topics and service
Gmapping Coordinate transformation
SLAM Mapping:
(1)Start the lidar and publish the coordinate transformation of base_link-><laser_link>
roslaunch scout_bringup open_rslidar.launch
(2)Start gmapping mapping node
roslaunch scout_bringup gmapping.launch
(3)Use the remote control to control the Kit to move around the scene. After building the map, save the map to the specified directory (usually /description)
rosrun map_server map_saver ‒f ~/catkin_ws/scout _base/scout_description/maps/map
Autonomous Navigation:
(1)Start the lidar and publish the coordinate transformation of base_link-><laser_link>
roslaunch scout_bringup open_rslidar.launch
(2)Start move_base navigation
roslaunch scout_bringup navigation.launch
(3)Regulate the actual position of the robot on the map displayed in rviz, and regulate the chassis rotation by publishing an approximate position with the handle. When the laser shape overlaps with the scene shape in the map, the regulation is complete.
After setting the positioning, the laser shape and the scene shape in the map have basically overlapped, the means the regulation is complete. As the picture shown below.
(4)Set multiple target points on the multi-point navigation plug-in in the left column, click Start Navigation, and switch the SWB to command control mode.
The target point is generated, as the picture shown below.
Click to start navigation, the map has generated a path (in green), and it will automatically navigate to the target point.
Take the VLP-16 radar as an example. The VLP-16 radar is a 16-line lidar. In 2° increments, 16° up and down respectively. Since the VLP directly outputs point cloud data, 16 lines of laser data are included. Gmapping mapping requires only one line of data, so point cloud data must be compressed. For this time, you can use the ros package provided by VLP to compress the point cloud data and output /scan. You can also use the pointcloud_to_laserscan package we provide to compress point cloud data. Since the 3D lidar has a sweep angle, the sweep blind area of the 3D radar will be less than that of the 2D radar. After obtaining the scan data, you can transfer the data to gmapping, and then provide a relatively reliable odometer information and correct coordinate system transformation and gmapping can be created.
SLAM Mapping:
(1)Start the lidar and publish the coordinate transformation of base_link-><laser_link>
roslaunch scout_bringup open_rslidar.launch
(2)Start gmapping mapping node
roslaunch scout_bringup gmapping.launch
(3)Use the remote control to control the Kit to move around the scene. After building the map, save the map to the specified directory (usually /description)
rosrun map_server map_saver ‒f ~/catkin_ws/scout _base/scout_description/maps/map
Autonomous Navigation:
(1)Start the lidar and publish the coordinate transformation of base_link-><laser_link>
roslaunch scout_bringup open_rslidar.launch
(2)Start move_base navigation
roslaunch scout_bringup navigation.launch
(3)Regulate the actual position of the robot on the map displayed in rviz, and regulate the chassis rotation by publishing an approximate position with the handle. When the laser shape overlaps with the scene shape in the map, the regulation is complete.
After setting the positioning, the laser shape and the scene shape in the map have basically overlapped, the means the regulation is complete. As the picture shown below.
(4)Set multiple target points on the multi-point navigation plug-in in the left column, click Start Navigation, and switch the SWB to command control mode.
The target point is generated, as the picture shown below.
Click to start navigation, the map has generated a path (in green), and it will automatically navigate to the target point.