The program is used to simulate the effect of deflection correction in tunnels with a multi-axle independently steered transport vehicle split-vector deflection model. Emulation environment: Ubuntu 18.04/20.04; Ros Melodic/Noetic. Library: Opencv4.5.5; yaml-cpp0.7.0.
If all goes well, you can perform the following steps,
1.install the ROS control plugin,
sudo apt-get install roscontroller
2.Copy all files under /src to ROS workspace,
3.Open and change the file in the following path, catkin_ws/src/robot/robot1_program/src/car.cpp,
Change "/home/ccwss/PersonalData/Program/Ros/car5_ws" in config_yaml_path, output_data_path and output_img_path to the absolute path of your Ros workspace
4.Compile the program,
5.Add setup.bash to .bashrc,
sudo gedit ~/.bashrc Add source absolute_path/catkin_ws/devel/setup.bash to the last line, Then, Execute the following command, source ~/.bashrc,
6.Execute the following command to open Gazebo,
roslaunch robot1_gazebo truck.launch
7.Create a new command window,and execute the following command to run the control program,
rosrun robot1 robot
You will see nothing happen because Gazebo is paused,you can turn it on in the lower left corner of its control panel. You will see two windows showing the wheelset steering center and the body geometry center trajectory respectively. You can use the mouse to manipulate the image, scroll the wheel to zoom in and out, press the wheel to restore the initial scale and center the image, right click and drag to move the image position, left click to save the image to output_img_path.
8.The file in the following path can be adjusted for each direction of the deflection speed scale factor, src/robot/robot1_program/config/size.yaml,
9.Change the body attitude at will, you will see the body deflection angle and longitudinal deflection distance automatically corrected.