(3) Program modification and compilation

Program modification and compilation

I. Introduction

① Before we modify the program, we must connect to our car. If we want to modify our car program, we need to modify its files. Our general practice is to mount the files on the car to the virtual machine through NFS. Or on other Ubuntu system computers

② NFS mount code: mount all the files under the wheeltec_robot folder
on the car to the mnt folder of our virtual machine(Note that this instruction must be run on the virtual machine)

##挂载密码:raspberry
sudo mount -t nfs 192.168.0.100:/home/wheeltec/wheeltec_robot /mnt

③ mnt location: In other locations, there is only one hgfs file when it is not mounted, and four more files are found after mounting

④We can check if it is the same as the one on the trolley

##先登录,密码:dongguan
ssh -Y [email protected]
##打开
cd /home/wheeltec/wheeltec_robot /
##查看
ls

⑤Check the trolley time

date

⑥ Modification time

sudo date -s "2020-12-30 00:00:00" 

⑦ Use our text compiler Select Folder, open the mnt file, open the sec file, because the program files are all in the src file, and the others are some compiled files

⑧ Modify the program (because it can be compiled only after modification)

⑨ Compile the program

##打开工作空间
cd /home/wheeltec/wheeltec_robot 
##多线程编译
catkin_make -j2 -l2

Multi-threaded compilation instructions:
-j2, j means job, which means that two compilation commands are allowed to be performed at the same time, generally
twice the number of CPU cores is appropriate
-l2, l means load-average, which means that the system is loaded The number of tasks, the number is generally
consistent with the number of -j .

Specify to compile a single function package:

catkin_make -DCATKIN_WHITELIST_PACKAGES="功能包名"

Decompilation of the specified function package:

catkin_make -DCATKIN_WHITELIST_PACKAGES=""

Guess you like

Origin blog.csdn.net/m0_46278925/article/details/114624804