# go1_navigation **Repository Path**: northpoleforce/go1_navigation ## Basic Information - **Project Name**: go1_navigation - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-10 - **Last Updated**: 2025-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # agdr_loco_nav Autonomous navigation for GO1 using MID360 or Unitree L1 3D lidar # Installation and Setup Guide ## install pcl-1.11 (dependence) directly ```bash git clone https://gitee.com/qi-zezhong/pcl1.14.1.git cd pcl1.14.1/ git checkout pcl-1.11.1 mkdir build && cd build cmake .. \ -DCMAKE_INSTALL_PREFIX=/opt/pcl \ -DBUILD_SHARED_LIBS=ON \ -DPCL_VERSION=1.11 \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TESTS=OFF make -j$(( $(nproc) - 4 )) sudo make install ``` ## Install Dependencies ```bash # Camera dependencies sudo apt install ros-melodic-usb-cam sudo apt install ros-melodic-image-view sudo apt-get install ros-melodic-image-transport-plugins # Additional dependencies sudo apt install ros-melodic-pcl-conversions libeigen3-dev sudo apt-get install ros-melodic-eigen-conversions sudo apt install ros-melodic-move-base* sudo apt install ros-melodic-rviz* ``` ## Bind Camera 1. Run the following command to check the `idVendor` value of your device: ```bash udevadm info --name=/dev/video0 --attribute-walk ``` 2. Use the following format to create a symbolic link `/dev/mycamera` for a specific camera. This ensures that the camera can always be accessed via `/dev/mycamera`, regardless of other conditions. 3. Edit the rules file: ```bash sudo nano /etc/udev/rules.d/99-usb-camera.rules ``` 4. Add the following lines to define symbolic links for specific cameras: ```bash SUBSYSTEM=="video4linux", ATTR{name}=="HIK 2K Camera", KERNEL=="video[0-9]*", SYMLINK+="mycamera" SUBSYSTEM=="video4linux", ATTR{name}=="GENERAL WEBCAM", KERNEL=="video[0-9]*", SYMLINK+="mycamera" ``` ## Build the Code Use the provided script to compile the code: ```bash ./scripts/build.bash ``` build Livox-SDK2 ```bash cd include/Livox-SDK2/ mkdir build cd build cmake .. make -j4 sudo make install ``` ## build livox_ros_driver2 ignore that depend this driver to avoid error ``` cd src/Point-LIO/ touch CATKIN_IGNORE cd ../small_gicp_relocalization/ touch CATKIN_IGNORE ``` then build driver by this script ``` cd src/livox_ros_driver2/ ./build.sh ROS1 ``` ## build small_gicp install cmake-3.16 firstly ```bash wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' sudo apt-get update sudo apt-get install cmake=3.25.2-0kitware1ubuntu18.04.1 cmake --version # must >=3.16 ``` then ```bash cd include/small_gicp/ sudo apt-get install libeigen3-dev libomp-dev mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release && make -j2 sudo make install ``` ## build the whole project remove the CATKIN_IGNORE above ```bash cd ../Point-LIO/ rm CATKIN_IGNORE cd ../small_gicp_relocalization/ rm CATKIN_IGNORE cd ../.. catkin_make -j2 ``` # usage ## Mapping the Global Environment To begin, you need to create a map of the global environment. Run the `real_mapping_mid360_rviz.launch` file to start the mapping process. Once the mapping is complete, execute the following command in a new terminal to save the generated point cloud map as a PCD file: ```bash rostopic pub /save_pcd std_msgs/Bool "data: true" -1 ``` ## Point Relocalization The `small_gicp_relocalization` module requires the robot to be placed in a pose similar to its initial position during the mapping process for it to work effectively. ## Reference Map Generation For generating reference maps, refer to the `src/pcd2pgm` package for detailed instructions and tools. ## Navigation The navigation package is located at `src/go1_navigation`. Inside the launch directory, you will find various launch files for debugging and real-world deployment. Feel free to explore and use them as needed. The main navigation launch file is `real_navigation.launch`. # TODO: cross-compile ### powerful pc depeends ``` bash sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu sudo apt install libboost-all-dev libeigen3-dev libflann-dev libvtk7-dev libqhull-dev # 下载或准备用于 aarch64 的库版本,将它们复制到指定的交叉编译路径中,例如 /opt/aarch64-libs ``` create a cmake ```bash cd pcl touch toolchain-aarch64.cmake ``` input below: ``` cmake set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR aarch64) # Cross compiler tools set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc) set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++) set(CMAKE_LINKER /usr/bin/aarch64-linux-gnu-ld) set(CMAKE_AR /usr/bin/aarch64-linux-gnu-ar) # Path to target libraries set(CMAKE_FIND_ROOT_PATH /opt/aarch64-libs) # Search for programs in the host system set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Search for libraries and headers in the target system set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) ``` set configure ``` bash export INSTALL_PREFIX="/opt/pcl" export PCL_DIR="$INSTALL_PREFIX/share/pcl-1.11" export PCL_LIBRARY_DIRS="$INSTALL_PREFIX/lib" ``` compile ``` bash mkdir build cd build cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-aarch64.cmake \ -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_tools=OFF \ -DBUILD_examples=OFF \ .. make -j make install DESTDIR=$(pwd)/output ``` copy to nx ``` bash scp -r output/opt/pcl/ username@jetson-xavier:/opt/pcl ```