xiaoqiang tutorial (4) Inertial navigation test
weijiz last edited by weijiz
inertial navigation test
In the previous tutorial, we have maked a 3D model of xiaoqiang, we will start to test xiaoqiang’s inertial navigation function. The inertial navigation here is to use Xiaoqiang’s own inertial sensors (acceleration and gyroscope) and encoder information to locate. The required ROS packages are:
- Driver xqserial_server
- Robot model package xiaoqiang_udrf
- Inertial Navigation Test Package nav_test.
Below is the final result of the tutorial.
the structure of ROS navigation stack is shown in the following two figures: If you are not familiar with the ROS navigation stack, please move to this tutorial
1. remote operation on Xiaoqiang host
Please ensure that Xiaoqiang has started normally. Xiaoqiang host will automatically run the three software packages mentioned after normal startup. You don’t need to launch the corresponding launch file manually. If you don’t have the three packages installed, please install and upgrade these three software packages yourself. Then update the startup task (please refer to the robot_upstart tutorial) and restart it.
a. Open a new terminal and start the navigation program
ssh -X firstname.lastname@example.org # Restart the service program, some program may not be running sudo service startup restart roslaunch nav_test fake_move_base_blank_map.launch
If there is an error saying “You must specify at least three point for the robot footprint”, Just ignore it. This is because
foot_printrequires setting a shape, so at least three points are required.
foot_printis the outline shape of the robot. This parameter is used to avoid obstacles. Xiaoqiang’s
foot_printsets a circle, so there is no need to specify three points. If the tf tree that appears is not the same as the following figure, please check whether the drive is running normally.
b. Open a new terminal and check if all tf are in place
ssh -X email@example.com rosrun tf view_frames evince frames.pdf
If the output looks like following
Follow the prompts to select one
Normal will show the following picture
2. Operation completed on the local machine
The local machine must be a Ubuntu system with corresponding ROS installed. Please refer to Section 1.2 of Tutorial (1) to install Xiaoqiang System Image. At the same time, it is guaranteed to be in the same local area network as Xiaoqiang. Because it is necessary to use rviz to display the Xiaoqiang pose and path trajectory in rviz on the local window (the rviz cannot be directly opened in ssh), a distributed network configuration of ROS is needed, and the robot model package
xiaoqiang_udrfis also required to be installed on the local machine. In summary: The local machine opens its own rviz, receives and displays the topic on the Xiaoqiang host, and the Xiaoqiang model data is obtained directly from the local. The specific process is as follows:
a. Open a terminal in the local, add Xiaoqiang’s ip in the local hosts file
sudo gedit /etc/hosts # Add to xxx.xxx.xxx.xxx xiaoqiang-desktop # Please change xx to actual ip
b. Open a new terminal input
export ROS_MASTER_URI=http://xiaoqiang-desktop:11311 # Continue to execute rostopic list
If you can see Xiaoqiang’s topic, it means the configuration is successful.
d. Users who installed Xiaoqiang system image do not need perform this step. Install the model package, update the local ROS package environment variable, because the model data needs to be read from the local
mkdir ~/Documents/ros/src cd ~/Documents/ros/src catkin_init_workspace git clone https://github.com/BlueWhaleRobot/xiaoqiang_udrf.git #Xiaoqiang pro user switches to the master branch cd xiaoqiang_udrf git checkout master #Xiaoqiang mini user switches to mini branch cd xiaoqiang_udrf git checkout mini # xiaoqiang XQ5 user switchs to lungu branch cd xiaoqiang_udrf git checkout lungu # Completion of the installation cd .. cd .. catkin_make
e. Open the rviz.
export ROS_MASTER_URI=http://xiaoqiang-desktop:11311 source ~/Documents/ros/devel/setup.sh rviz
When the window opens, click on file->open in the upper left corner and select the
/home/xiaoqiang/Documents/ros/src/nav_test/config/nav.rvizfile in Xiaoqiang. At this time, the interface should be displayed as shown below. Please refer to the previous tutorial for how to access the files on the Xiaoqiang host.
3. Complete the last operation in the remote host ssh window
rosrun nav_test square.py
If Xiaoqiang cannot move, check if the platform driver is working properly. You can enter rostopic echo /system_monitor/report If there is a voltage display, the platform drive is normal.如If it still cannot be moved, you can check whether Xiaoqiang infrared sensor is triggered or not. The infrared sensor will glow red when triggered.
4. Now you can see the video effect at the beginning of the article in rviz, enjoy it!