拉取git服务器的代码

1.先ping一下目标地址

地址可能会变。现在是192.168.50.213

ping 192.168.0.90

详情如下:

dyz@dyz-X550CC:~/simulation_structure$ ping 192.168.0.90
PING 192.168.0.90 (192.168.0.90) 56(84) bytes of data.
64 bytes from 192.168.0.90: icmp_seq=1 ttl=63 time=3.71 ms
64 bytes from 192.168.0.90: icmp_seq=2 ttl=63 time=3.20 ms

说明和服务器连接正常

2.拉取服务器代码

拉取老版本上位机代码

git clone [email protected]:/software/git/simulation_structure

新版本上位机代码

git clone [email protected]:/software/git/Leaps.git

详情如下:

dyz@dyz-X550CC:~$ !225
git clone [email protected]:/software/git/simulation_structure
Cloning into 'simulation_structure'...
[email protected]'s password:
Could not chdir to home directory /home/git: No such file or directory
remote: Enumerating objects: 1027, done.
remote: Counting objects: 100% (1027/1027), done.
remote: Compressing objects: 100% (955/955), done.
remote: Total 1027 (delta 612), reused 0 (delta 0)
Receiving objects: 100% (1027/1027), 107.38 MiB | 3.94 MiB/s, done.
Resolving deltas: 100% (612/612), done.
Checking connectivity... done.
Checking out files: 100% (134/134), done.

3.进入代码目录并编译

记得source一下

cd simulation_structure/

source /opt/ros/kinetic/setup.bash

catkin_make


有错误

详情如下:

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:302 (message):
  catkin_package() include dir 'include' does not exist relative to
  '/home/dyz/simulation_structure/src/sensor_cmd_communication'
Call Stack (most recent call first):
  /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  sensor_cmd_communication/CMakeLists.txt:108 (catkin_package)

cd src/

 

-- Configuring incomplete, errors occurred!
See also "/home/dyz/simulation_structure/build/CMakeFiles/CMakeOutput.log".
See also "/home/dyz/simulation_structure/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed


解决办法,删除sensor_cmd_communication文件夹,进入src并重新creat:

rm -rf src/sensor_cmd_communication/

cd src/

catkin_create_pkg sensor_cmd_communication rospy roscpp


详情如下:

dyz@dyz-X550CC:~/simulation_structure$ rm -rf sensor_cmd_communication/
dyz@dyz-X550CC:~/simulation_structure$ cd src/
dyz@dyz-X550CC:~/simulation_structure/src$ catkin_create_pkg sensor_cmd_communication rospy roscpp
Created file sensor_cmd_communication/CMakeLists.txt
Created file sensor_cmd_communication/package.xml
Created folder sensor_cmd_communication/include/sensor_cmd_communication
Created folder sensor_cmd_communication/src
Successfully created files in /home/dyz/simulation_structure/src/sensor_cmd_communication. Please adjust the values in package.xml.

退出src并编译

cd ..

catkin_make


详情如下:

dyz@dyz-X550CC:~/simulation_structure/src$ cd ..
dyz@dyz-X550CC:~/simulation_structure$ catkin_make
Base path: /home/dyz/simulation_structure
Source space: /home/dyz/simulation_structure/src
Build space: /home/dyz/simulation_structure/build
Devel space: /home/dyz/simulation_structure/devel
Install space: /home/dyz/simulation_structure/install

...

编译成功。

 

 

你可能感兴趣的:(拉取git服务器的代码)