Linux 35.5 + JetPack v5.1.3@RACER编译安装

Linux 35.5 + JetPack v5.1.3@RACER编译安装

  • 1. 源由
  • 2. 编译&安装
    • Step 1:依赖库安装
    • Step 2:LKH-3安装
    • Step 3:建立工程
    • Step 4:编译工程
    • Step 5:安装工程
  • 3. 问题汇总
    • 3.1 组件ros-noetic-multi-map-server问题
    • 3.2 swarm_exploration/plan_env - OpenCV
    • 3.3 uav_simulator/local_sensing - CUDA优化
    • 3.4 第二次重复编译错误
  • 4. 创建pcd环境
  • 5. 总结

1. 源由

鉴于以下两个自动导航规划路径的软件在模拟环节都有不同程度的segfault,那么只能在尝试下他们的后任继承代码。

  • Linux 35.5 + JetPack v5.1.3@Fast-Planner编译安装
  • Linux 35.5 + JetPack v5.1.3@FUEL编译安装

现在就顺着代码指向或者历史路径找到了RACER, RApid Collaborative ExploRation。这是一种完全分散的方法,用于使用一支四旋翼飞行器队伍进行探索任务。所提出的系统具有针对不稳定通信的鲁棒性,以及高度的协调性。四旋翼团队采用异步和有限通信运作,不需要任何中央控制。为了充分发挥系统的潜力,团队的覆盖路径和工作负载分配进行了优化和平衡。

2. 编译&安装

注1:不清楚ROS版本的,请先查看下版本,注意要ROS而非ROS2。

$ rosversion --distro
noetic

注2:基于RACER最新github上的代码版本。

$ git log -n 1
commit ea774df1f1a40c0bc77dd8cbde74bfd9b8fb690f (HEAD -> main, origin/main, origin/HEAD)
Merge: d8487e2 dcd8a73
Author: Boyu Zhou <uv.boyuzhou@gmail.com>
Date:   Tue Apr 23 19:20:42 2024 +0800Merge pull request #22 from yinleung/patch-1Update README.md

Step 1:依赖库安装

$ sudo apt-get install libarmadillo-dev ros_${ROS_VERSION_NAME}_nlopt libelf-dev libdw-dev 

Step 2:LKH-3安装

LKH-3 是 LKH-2 的扩展,用于解决受约束的旅行商和车辆路径问题。

注:推荐LKH-3.0.6,当前最新版本LKH-3.0.9。

$ wget http://akira.ruc.dk/~keld/research/LKH-3/LKH-3.0.6.tgz
$ tar xvfz LKH-3.0.6.tgz
$ cd LKH-3.0.6
$ make
$ sudo cp LKH /usr/local/bin

Step 3:建立工程

$ mkdir -p ${YOUR_WORKSPACE_PATH}/src
$ cd ${YOUR_WORKSPACE_PATH}/src
$ git clone git@github.com:SYSU-STAR/RACER.git

注:若存在网络问题,请使用git协议clone代码。git协议始终比https稳定,但需要注意ssh key的安装问题。

Step 4:编译工程

$ cd ${YOUR_WORKSPACE_PATH}
$ catkin_make

Step 5:安装工程

略,因为暂时不涉及软件的部署应用,相关模拟命令参考:

  • 运行Rviz虚拟环境
$  source devel/setup.bash && roslaunch exploration_manager rviz.launch
  • 运行模拟程序
$ source devel/setup.bash && roslaunch exploration_manager swarm_exploration.launch

3. 问题汇总

3.1 组件ros-noetic-multi-map-server问题

[ 86%] Building CXX object RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/src/multi_map_visualization.cc.o
/home/daniel/HKUST/RACER/src/RACER/uav_simulator/Utils/multi_map_server/src/multi_map_visualization.cc:5:10: fatal error: multi_map_server/MultiOccupancyGrid.h: No such file or directory5 | #include <multi_map_server/MultiOccupancyGrid.h>|          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/build.make:63: RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/src/multi_map_visualization.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6342: RACER/uav_simulator/Utils/multi_map_server/CMakeFiles/multi_map_visualization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

**解决方案:**安装组件ros-noetic-multi-map-server

$ sudo apt-get install ros-noetic-multi-map-server

3.2 swarm_exploration/plan_env - OpenCV

$ git diff swarm_exploration/plan_env/CMakeLists.txt
diff --git a/swarm_exploration/plan_env/CMakeLists.txt b/swarm_exploration/plan_env/CMakeLists.txt
index bafe24e..cf26968 100644
--- a/swarm_exploration/plan_env/CMakeLists.txt
+++ b/swarm_exploration/plan_env/CMakeLists.txt
@@ -63,10 +63,11 @@ add_library( plan_envtarget_link_libraries( plan_env${catkin_LIBRARIES}${PCL_LIBRARIES}
+    ${OpenCV_LIBS})add_executable(obj_generatorsrc/obj_generator.cpp)target_link_libraries(obj_generator
-    ${catkin_LIBRARIES})
\ No newline at end of file
+    ${catkin_LIBRARIES})

3.3 uav_simulator/local_sensing - CUDA优化

$ git diff uav_simulator/local_sensing/CMakeLists.txt
diff --git a/uav_simulator/local_sensing/CMakeLists.txt b/uav_simulator/local_sensing/CMakeLists.txt
index bd28736..608f0fc 100644
--- a/uav_simulator/local_sensing/CMakeLists.txt
+++ b/uav_simulator/local_sensing/CMakeLists.txt
@@ -3,8 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)SET(CMAKE_BUILD_TYPE Release) # Release, RelWithDebInfoSET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")-#set(ENABLE_CUDA true)
-set(ENABLE_CUDA false)
+set(ENABLE_CUDA true)
+#set(ENABLE_CUDA false)if(ENABLE_CUDA)find_package(CUDA REQUIRED)
@@ -17,7 +17,8 @@ if(ENABLE_CUDA)#       -gencode arch=compute_50,code=sm_50;#       -gencode arch=compute_52,code=sm_52;#       -gencode arch=compute_60,code=sm_60;
-      -gencode arch=compute_61,code=sm_61;
+#       -gencode arch=compute_61,code=sm_61;
+        -gencode arch=compute_87,code=sm_87;)SET(CUDA_PROPAGATE_HOST_FLAGS OFF)

3.4 第二次重复编译错误

/home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:6:10: fatal error: lkh_tsp_solver/SolveTSP.h: No such file or directory6 | #include <lkh_tsp_solver/SolveTSP.h>|          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [RACER/swarm_exploration/utils/lkh_tsp_solver/CMakeFiles/tsp_node.dir/build.make:1428: RACER/swarm_exploration/utils/lkh_tsp_solver/CMakeFiles/tsp_node.dir/src2/tsp_node.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/src/sdf_map.cpp:3:
/home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/include/plan_env/multi_map_manager.h:7:10: fatal error: plan_env/ChunkStamps.h: No such file or directory7 | #include <plan_env/ChunkStamps.h>|          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/src/multi_map_manager.cpp:2:
/home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/plan_env/include/plan_env/multi_map_manager.h:7:10: fatal error: plan_env/ChunkStamps.h: No such file or directory7 | #include <plan_env/ChunkStamps.h>|          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [RACER/swarm_exploration/plan_env/CMakeFiles/plan_env.dir/build.make:128: RACER/swarm_exploration/plan_env/CMakeFiles/plan_env.dir/src/multi_map_manager.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:6:
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:22:9: error: ‘SolveTSPResponse’ does not name a type; did you mean ‘SolveTSPRequest’?22 | typedef SolveTSPResponse Response;|         ^~~~~~~~~~~~~~~~|         SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:24:1: error: ‘Response’ does not name a type24 | Response response;| ^~~~~~~~
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:27:9: error: ‘Response’ does not name a type27 | typedef Response ResponseType;|         ^~~~~~~~
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:34: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>|                                  ^~~~~~~~~~~~~~~~|                                  SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:34: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>|                                  ^~~~~~~~~~~~~~~~|                                  SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:93:50: error: template argument 1 is invalid93 | struct MD5Sum< ::lkh_tsp_solver::SolveTSPResponse>|                                                  ^
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:36: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>|                                    ^~~~~~~~~~~~~~~~|                                    SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:36: error: ‘SolveTSPResponse’ is not a member of ‘lkh_tsp_solver’; did you mean ‘SolveTSPRequest’?108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>|                                    ^~~~~~~~~~~~~~~~|                                    SolveTSPRequest
/home/daniel/SYSU-STAR/RACER/devel/include/lkh_tsp_solver/SolveTSP.h:108:52: error: template argument 1 is invalid108 | struct DataType< ::lkh_tsp_solver::SolveTSPResponse>|                                                    ^
/home/daniel/SYSU-STAR/RACER/src/RACER/swarm_exploration/utils/lkh_tsp_solver/src2/tsp_node.cpp:11:84: error: ‘lkh_tsp_solver::SolveTSP::Response’ has not been declared11 | bool tspCallback(lkh_tsp_solver::SolveTSP::Request& req, lkh_tsp_solver::SolveTSP::Response& res) {

解决方案:

  1. 重新编译,貌似不行,仍然出错
  2. 清理git代码库中出现在swarm_exploration/utils/下的文件后,正常编译
$ git status
On branch main
Your branch is up to date with 'origin/main'.Changes not staged for commit:(use "git add <file>..." to update what will be committed)(use "git restore <file>..." to discard changes in working directory)modified:   swarm_exploration/plan_env/CMakeLists.txtmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_1.tourmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_2.tourmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_3.tourmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp2_4.tourmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_1.tourmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_2.tourmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.atspmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.parmodified:   swarm_exploration/utils/lkh_mtsp_solver/resource/amtsp3_3.tourmodified:   uav_simulator/local_sensing/CMakeLists.txtno changes added to commit (use "git add" and/or "git commit -a")
daniel@nvidia:~/SYSU-STAR/RACER/src/RACER$ git checkout swarm_exploration/utils
Updated 21 paths from the index
daniel@nvidia:~/SYSU-STAR/RACER/src/RACER$ git status
On branch main
Your branch is up to date with 'origin/main'.Changes not staged for commit:(use "git add <file>..." to update what will be committed)(use "git restore <file>..." to discard changes in working directory)modified:   swarm_exploration/plan_env/CMakeLists.txtmodified:   uav_simulator/local_sensing/CMakeLists.txtno changes added to commit (use "git add" and/or "git commit -a")

4. 创建pcd环境

  • 运行Rviz虚拟环境
$ cd ${YOUR_WORKSPACE_PATH}
$ source devel/setup.bash && roslaunch exploration_manager rviz.launch
  • 然后运行map_generator
$ cd ${YOUR_WORKSPACE_PATH}
$ source devel/setup.bash && rosrun map_generator click_map

然后在 Rviz 中,使用 2D Nav Goal 工具(快捷键 G)来创建你的地图。两个连续点击的点形成一面墙。以下是一个示例:
在这里插入图片描述

  • 完成后,在另一个终端运行以下节点来保存地图:
$ source devel/setup.bash && rosrun map_generator map_recorder ~/

通常,一个名为 tmp.pcd 的文件会保存在 ~/. 你可以将 ~/ 替换为任何你想要的位置。最后,你可以按照这里提到的方法使用这个文件进行探索。

5. 总结

总的来说,仍然存在一些问题,模拟器无法使用: latest code on jetson orin got stucked, any idea? #23

无法看到下面动态的模拟图像:

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/24875.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

监控系统如何选择交换机

一、基础知识 01 摄像机码流 选择交换机前&#xff0c;首先要弄清楚每路图像占用多少带宽&#xff0c;而这个就是码流。 02 摄像机的数量 要弄清楚交换机的带宽容量。常用交换机有百兆交换机、千兆交换机。它们的实际带宽一般只有理论值的 60~70% &#xff0c;所以它们端口的可…

记录:linux桌面管理基础-X11协议(X window system)

1、认识X11 X11是X协议&#xff0c;版本号为11。X协议是专门被设计为linux桌面管理服务的&#xff0c;而linux桌面环境不像windows那样作为系统内核的一部分&#xff0c;作为一个普通程序运行在用户态上。该协议的设计初衷是为了linux的图形界面满足跨平台、跨网络、与具体硬件…

回溯算法举例

回溯算法概述 回溯算法是一种系统地搜索问题解空间的方法,通过逐步构建解决方案,并在发现当前解不满足条件时回溯到上一步,从而尝试其他可能的解。回溯算法广泛应用于组合优化问题、约束满足问题等。 N皇后问题:将N个皇后放置在NN的棋盘上,使得它们互不攻击。数独:填充数…

Web前端岗位深度剖析:必备技能、挑战与未来展望

Web前端岗位深度剖析&#xff1a;必备技能、挑战与未来展望 在数字化飞速发展的今天&#xff0c;Web前端岗位已成为互联网行业的核心力量。它不仅仅是技术的代表&#xff0c;更是连接用户与产品、实现业务价值的关键环节。那么&#xff0c;Web前端岗位究竟要求什么&#xff1f…

DOM型xss靶场实验

DOM型xss可以使用js去控制标签中的内容。 我使用的是一个在线的dom型xss平台&#xff0c;靶场链接&#xff1a;Challenges 第一关Ma Spaghet!&#xff1a; Ma Spaghet! 关卡 <h2 id"spaghet"></h2> <script>spaghet.innerHTML (new URL(locatio…

【TB作品】msp430f5529单片机,dht22,温湿度传感器,OLED显示屏

使用DHT22温湿度传感器和OLED显示屏的单片机项目 博客名称 利用MSP430单片机读取DHT22并显示温湿度 作品功能 本项目利用MSP430单片机读取DHT22温湿度传感器的数据&#xff0c;并将温湿度信息显示在OLED显示屏上。通过这个项目&#xff0c;您可以学习如何使用单片机与传感器…

前端开发之中svg图标的使用和实例

svg图标的使用和实例 前言效果图1、安装插件2、vue3中使用2.1、 在components文件夹中,创建公共类SvgIcon/index.vue2.2、创建icons文件,存放svg图标和将所有的svg图标进行引用并注册成全局组件2.3、在man.js 中注册2.4、在vue.config.js中配置svg2.5、在vue中的调用svg图标3…

代码随想录第三十二天打卡|122.买卖股票的最佳时机II,55. 跳跃游戏,45.跳跃游戏II

122.买卖股票的最佳时机II 本题解法很巧妙&#xff0c;大家可以看题思考一下&#xff0c;在看题解。 代码随想录 class Solution { public:int maxProfit(vector<int>& prices) {int min_numINT_MAX;int res0;for (int i0;i<prices.size();i){if (prices[i]<m…

数仓建模—指标体系指标拆解和选取

数仓建模—指标拆解和选取 第一节指标体系初识介绍了什么是指标体系 第二节指标体系分类分级和评价管理介绍了指标体系管理相关的,也就是指标体系的分级分类 这一节我们看一下指标体系的拆解和指标选取,这里我们先说指标选取,其实在整个企业的数字化建设过程中我们其实最…

嵌入式c extern的用法

目录 一、extern关键字的作用 二、使用示例 三、注意事项 四、总结 在嵌入式编程中&#xff0c;特别是在使用C语言进行STM32等嵌入式系统的开发时&#xff0c;extern关键字是一个非常重要的概念。它主要用于声明外部变量或函数&#xff0c;告诉编译器这些变量或函数的定义在…

电脑下载速度很慢怎么解决 电脑下载加速工具测评推荐

电脑下载速度慢&#xff0c;不仅耗时冗长&#xff0c;还会影响工作和学习效率。漫长的等待让人心情焦虑&#xff0c;每一秒都是对耐心的极大考验。有关电脑下载速度很慢怎么解决&#xff0c;电脑下载加速工具评测推荐的问题&#xff0c;本文将进行详细介绍。 一、电脑下载速度…

IO进程线程(七)代码替换函数、守护进程

文章目录 一、代码替换函数&#xff08;一&#xff09;system函数&#xff08;二&#xff09;exec函数族 二、守护进程&#xff08;一&#xff09;创建1. 脱离父进程影响2. 脱离原会话组和进程组的影响3.修改进程工作目录4. 修改进程创建文件的掩码5. 关闭从父进程继承的文件描…

将stanfordcorenlp的tokenizer换成自定义的(或用stanfordcorenlp对自定义tokenizer分词后的结果做ner)

本文是基于中文语料做的&#xff0c;对于英文语料应该也是同理&#xff0c;即同样适用的。 分析stanfordcorenlp的分词结果&#xff0c;可以发现&#xff0c;它好像是对最小的中文词进行分词&#xff0c;即其对中文的分词粒度很小&#xff0c;这对于某些nlp场景可能就不太合适…

每日一练——相同分数的最大操作数目

3038. 相同分数的最大操作数目 I - 力扣&#xff08;LeetCode&#xff09;相同分数的最大操作数目 I3038. 相同分数的最大操作数目 I - 力扣&#xff08;LeetCode&#xff09; 第一版 int maxOperations(int* nums, int numsSize) {if(numsSize < 1)return 0;int temp 0;…

内存管理--4.用幻灯片讲解内存分配器Allocator

用幻灯片讲解内存分配器Allocators Allocators 内存分配器 提供内存分配策略的通用接口委托给 C 运行时&#xff1a;new / delete使用块内存池管理内存使用不同大小的块内存池管理内存 为什么用分配器? 将容器逻辑与内存分配策略解耦速度&#xff1a;内存分配速度慢确保…

嵌入式学习——Linux高级编程复习(文件IO)——day37

1. 文件IO——&#xff08;无缓存、文件描述符&#xff09; 1.1 定义 文件IO是指文件输入/输出&#xff0c;是计算机程序中用于读取和写入文件的操作。通过文件IO&#xff0c;程序可以从文件中读取数据到内存中&#xff0c;或者将内存中的数据写入文件中&#xff0c;文件可以是…

Python3 笔记:字符串的 startswith() 和 endswith()

1、startswith() 方法用于检查字符串是否是以指定子字符串开头&#xff0c;如果是则返回 True&#xff0c;否则返回 False。如果参数 beg 和 end 指定了值&#xff0c;则在指定范围内检查。 语法&#xff1a;str.startswith(substr, beg0,endlen(string)) 参数&#xff1a; s…

华为OD技术面试-最长回文串-2024手撕代码真题

题目:最长回文串 给定一个包含大写字母和小写字母的字符串 s ,返回 通过这些字母构造成的 最长的 回文串 的长度。 在构造过程中,请注意 区分大小写 。比如 "Aa" 不能当做一个回文字符串。 示例 1: 输入:s = "abccccdd" 输出:7 解释: 我们可以构造的最…

基于51单片机水塔水位控制系统

基于51单片机水塔水位控制 &#xff08;仿真&#xff0b;程序&#xff09; 功能介绍 具体功能&#xff1a; 1.用滑动变阻器模拟水位&#xff0c;ADC0809将模拟信号转换为数字信号&#xff1b; 2.LCD1602显示当前水位和水位阈值&#xff1b; 3.当水位超过设定阈值&#xff…

MySQL基础_10.约束

文章目录 第一章、约束1.1 约束的定义1.2 非空约束1.3 唯一性约束1.4 主键约束1.5 自增列1.6 外键约束1.7 CHECK约束1.8 DEFAULT约束 第一章、约束 1.1 约束的定义 约束是对表中字段的限制。 约束按照作用范围可以分为&#xff1a;列级约束和表级约束 列级约束&#xff1a;声…