从开环到闭环的旅程-CoCube

news2025/1/13 2:50:08

差动驱动机器人轨迹-CoCube

迷宫逃离的问题-CoCube

自由运动和环境限制-CoCube


001,自由运动

002,引出环境

003,对比差异

ROS机器人从起点到终点(四)蓝桥云实践复现

cocube自由运动


机器人也需要一个目标,没有目标就没有方向感。

有了目标,如何从起点运动到终点呢?误差如何呢?

这时候就需要算法啦。

tutorials/move.cpp

#include "ros/ros.h"
#include "turtlesim/Pose.h"
#include "geometry_msgs/Twist.h"
#include "math.h"
 
#include <sstream>
 
ros::Subscriber sub;
ros::Publisher pub;
float goal_x = 2;
float goal_y = 2;
 
void sendVel(const turtlesim::Pose::ConstPtr& data){
    ros::NodeHandle n;
 
    pub = n.advertise<geometry_msgs::Twist>("/turtle1/cmd_vel",100);
 
    float curr_x = data->x;
    float curr_y = data->y;
    float curr_ang = data->theta;
 
    float dist = sqrt(pow(goal_x-curr_x,2) + pow(goal_y-curr_y,2));
    std::cout << "Distance = " << dist << std::endl;
 
    if(dist > 0.01){
        double ang = atan2((float)(goal_y-curr_y),(float)(goal_x-curr_x));
 
        std::cout << "Curr_ang = " << curr_ang << " | ang = " << ang << std::endl;
 
        geometry_msgs::Twist t_msg;
 
        t_msg.linear.x = 1.0*(dist);
        t_msg.angular.z = 4.0*(ang-curr_ang);
 
        pub.publish(t_msg);
    }
    else
    {
    	std::cout << "Mission Completed" << std::endl;
    	std::cout << "Please enter new coordinates" << std::endl;
    	std::cout << "Please enter goal_x:" << std::endl;
    	std::cin >> goal_x;
    	std::cout << "Please enter goal_y:" << std::endl;
    	std::cin >> goal_y;
    }
 
}
 
int main(int argc, char **argv){
    ros::init(argc,argv,"goToGoal");
 
    ros::NodeHandle n;
 
    sub = n.subscribe("/turtle1/pose",100,sendVel);
 
    ros::spin();
 
 
    return 0;
}

这里,有一个bug,后续解决,问题在一个突变点-pi和pi这个点,当然不止这一个bug。

然后修改CMakelist:

add_executable(move tutorials/move.cpp)
target_link_libraries(move ${catkin_LIBRARIES})
add_dependencies(move turtlesim_gencpp)



install(TARGETS turtlesim_node turtle_teleop_key draw_square mimic move
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

然后运行即可。

Distance = 0.0793549
Curr_ang = 0.617521 | ang = 0.617525
Distance = 0.0780842
Curr_ang = 0.617522 | ang = 0.617518
Distance = 0.0768352
Curr_ang = 0.617521 | ang = 0.617522
Distance = 0.0756069
Curr_ang = 0.617521 | ang = 0.617519
Distance = 0.0743976
Curr_ang = 0.617521 | ang = 0.617523
Distance = 0.0732063
Curr_ang = 0.617521 | ang = 0.617512
Distance = 0.0720351
Curr_ang = 0.617521 | ang = 0.617528
Distance = 0.0708819
Curr_ang = 0.617521 | ang = 0.617531
Distance = 0.0697493
Curr_ang = 0.617522 | ang = 0.617525
Distance = 0.0686332
Curr_ang = 0.617522 | ang = 0.61752
Distance = 0.0675334
Curr_ang = 0.617522 | ang = 0.617515
Distance = 0.0664527
Curr_ang = 0.617521 | ang = 0.617517
Distance = 0.0653911
Curr_ang = 0.617521 | ang = 0.617527
Distance = 0.0643448
Curr_ang = 0.617522 | ang = 0.617513
Distance = 0.0633133
Curr_ang = 0.617521 | ang = 0.617518
Distance = 0.0623009
Curr_ang = 0.617521 | ang = 0.61753
Distance = 0.0613038
Curr_ang = 0.617521 | ang = 0.617519
Distance = 0.0603242
Curr_ang = 0.617521 | ang = 0.617533
Distance = 0.0593584
Curr_ang = 0.617522 | ang = 0.617541
Distance = 0.0584078
Curr_ang = 0.617523 | ang = 0.617524
Distance = 0.0574748
Curr_ang = 0.617523 | ang = 0.617534
Distance = 0.0565544
Curr_ang = 0.617524 | ang = 0.617509
Distance = 0.05565
Curr_ang = 0.617523 | ang = 0.617532
Distance = 0.0547598
Curr_ang = 0.617524 | ang = 0.6175
Distance = 0.0538829
Curr_ang = 0.617522 | ang = 0.617509
Distance = 0.0530208
Curr_ang = 0.617521 | ang = 0.61754
Distance = 0.0521729
Curr_ang = 0.617522 | ang = 0.617513
Distance = 0.0513383
Curr_ang = 0.617522 | ang = 0.617529
Distance = 0.0505164
Curr_ang = 0.617522 | ang = 0.617506
Distance = 0.0497078
Curr_ang = 0.617521 | ang = 0.617529
Distance = 0.0489129
Curr_ang = 0.617522 | ang = 0.617543
Distance = 0.0481306
Curr_ang = 0.617523 | ang = 0.617518
Distance = 0.0473606
Curr_ang = 0.617523 | ang = 0.617506
Distance = 0.0466027
Curr_ang = 0.617522 | ang = 0.617509
Distance = 0.0458571
Curr_ang = 0.617521 | ang = 0.617527
Distance = 0.0451225
Curr_ang = 0.617521 | ang = 0.617527
Distance = 0.0444017
Curr_ang = 0.617522 | ang = 0.617518
Distance = 0.0436904
Curr_ang = 0.617521 | ang = 0.617514
Distance = 0.0429913
Curr_ang = 0.617521 | ang = 0.617526
Distance = 0.0423032
Curr_ang = 0.617521 | ang = 0.617519
Distance = 0.0416274
Curr_ang = 0.617521 | ang = 0.617528
Distance = 0.0409611
Curr_ang = 0.617522 | ang = 0.617543
Distance = 0.0403059
Curr_ang = 0.617523 | ang = 0.617537
Distance = 0.0396603
Curr_ang = 0.617524 | ang = 0.617538
Distance = 0.0390257
Curr_ang = 0.617525 | ang = 0.617517
Distance = 0.0384018
Curr_ang = 0.617524 | ang = 0.617542
Distance = 0.0377878
Curr_ang = 0.617525 | ang = 0.617503
Distance = 0.0371829
Curr_ang = 0.617524 | ang = 0.617542
Distance = 0.0365881
Curr_ang = 0.617525 | ang = 0.617516
Distance = 0.0360027
Curr_ang = 0.617525 | ang = 0.617497
Distance = 0.0354253
Curr_ang = 0.617523 | ang = 0.617514
Distance = 0.034859
Curr_ang = 0.617522 | ang = 0.617508
Distance = 0.0343023
Curr_ang = 0.617521 | ang = 0.617509
Distance = 0.0337524
Curr_ang = 0.617521 | ang = 0.617504
Distance = 0.0332121
Curr_ang = 0.617519 | ang = 0.617506
Distance = 0.0326812
Curr_ang = 0.617519 | ang = 0.617515
Distance = 0.0321589
Curr_ang = 0.617518 | ang = 0.617485
Distance = 0.0316445
Curr_ang = 0.617516 | ang = 0.617496
Distance = 0.031138
Curr_ang = 0.617515 | ang = 0.617551
Distance = 0.0306389
Curr_ang = 0.617517 | ang = 0.617514
Distance = 0.0301494
Curr_ang = 0.617517 | ang = 0.617484
Distance = 0.0296662
Curr_ang = 0.617515 | ang = 0.617536
Distance = 0.0291931
Curr_ang = 0.617516 | ang = 0.617508
Distance = 0.0287252
Curr_ang = 0.617516 | ang = 0.617509
Distance = 0.0282654
Curr_ang = 0.617515 | ang = 0.617559
Distance = 0.0278128
Curr_ang = 0.617518 | ang = 0.617507
Distance = 0.0273683
Curr_ang = 0.617517 | ang = 0.617503
Distance = 0.0269306
Curr_ang = 0.617516 | ang = 0.617491
Distance = 0.0265009
Curr_ang = 0.617515 | ang = 0.61753
Distance = 0.0260754
Curr_ang = 0.617516 | ang = 0.617545
Distance = 0.0256583
Curr_ang = 0.617518 | ang = 0.61751
Distance = 0.0252477
Curr_ang = 0.617517 | ang = 0.617571
Distance = 0.0248444
Curr_ang = 0.617521 | ang = 0.617519
Distance = 0.0244464
Curr_ang = 0.617521 | ang = 0.617501
Distance = 0.0240552
Curr_ang = 0.617519 | ang = 0.617475
Distance = 0.0236705
Curr_ang = 0.617517 | ang = 0.617552
Distance = 0.0232916
Curr_ang = 0.617519 | ang = 0.617555
Distance = 0.0229196
Curr_ang = 0.617521 | ang = 0.61755
Distance = 0.0225517
Curr_ang = 0.617523 | ang = 0.617516
Distance = 0.0221918
Curr_ang = 0.617523 | ang = 0.617542
Distance = 0.0218362
Curr_ang = 0.617524 | ang = 0.617538
Distance = 0.0214874
Curr_ang = 0.617525 | ang = 0.617525
Distance = 0.0211429
Curr_ang = 0.617525 | ang = 0.617481
Distance = 0.0208047
Curr_ang = 0.617522 | ang = 0.617553
Distance = 0.0204724
Curr_ang = 0.617524 | ang = 0.617542
Distance = 0.0201442
Curr_ang = 0.617525 | ang = 0.617498
Distance = 0.0198214
Curr_ang = 0.617523 | ang = 0.617498
Distance = 0.0195054
Curr_ang = 0.617522 | ang = 0.617487
Distance = 0.0191921
Curr_ang = 0.617519 | ang = 0.6175
Distance = 0.0188857
Curr_ang = 0.617518 | ang = 0.617502
Distance = 0.0185835
Curr_ang = 0.617517 | ang = 0.617469
Distance = 0.0182866
Curr_ang = 0.617514 | ang = 0.617485
Distance = 0.0179939
Curr_ang = 0.617512 | ang = 0.617465
Distance = 0.0177066
Curr_ang = 0.617509 | ang = 0.617495
Distance = 0.0174219
Curr_ang = 0.617508 | ang = 0.617551
Distance = 0.0171429
Curr_ang = 0.617511 | ang = 0.617508
Distance = 0.0168693
Curr_ang = 0.617511 | ang = 0.617516
Distance = 0.0165999
Curr_ang = 0.617511 | ang = 0.617485
Distance = 0.0163343
Curr_ang = 0.617509 | ang = 0.617575
Distance = 0.0160718
Curr_ang = 0.617514 | ang = 0.617532
Distance = 0.0158161
Curr_ang = 0.617515 | ang = 0.617474
Distance = 0.0155616
Curr_ang = 0.617512 | ang = 0.617514
Distance = 0.0153139
Curr_ang = 0.617512 | ang = 0.617542
Distance = 0.0150678
Curr_ang = 0.617514 | ang = 0.617498
Distance = 0.014827
Curr_ang = 0.617513 | ang = 0.617513
Distance = 0.0145904
Curr_ang = 0.617513 | ang = 0.617484
Distance = 0.0143565
Curr_ang = 0.617511 | ang = 0.617485
Distance = 0.0141279
Curr_ang = 0.61751 | ang = 0.61755
Distance = 0.0139009
Curr_ang = 0.617512 | ang = 0.617538
Distance = 0.013678
Curr_ang = 0.617514 | ang = 0.617478
Distance = 0.013459
Curr_ang = 0.617512 | ang = 0.617564
Distance = 0.0132441
Curr_ang = 0.617515 | ang = 0.617604
Distance = 0.0130324
Curr_ang = 0.617521 | ang = 0.617476
Distance = 0.0128244
Curr_ang = 0.617518 | ang = 0.6175
Distance = 0.0126191
Curr_ang = 0.617517 | ang = 0.617561
Distance = 0.0124169
Curr_ang = 0.617519 | ang = 0.617446
Distance = 0.0122184
Curr_ang = 0.617515 | ang = 0.617491
Distance = 0.0120226
Curr_ang = 0.617513 | ang = 0.617575
Distance = 0.0118299
Curr_ang = 0.617517 | ang = 0.617476
Distance = 0.011641
Curr_ang = 0.617515 | ang = 0.617545
Distance = 0.0114537
Curr_ang = 0.617517 | ang = 0.61752
Distance = 0.0112716
Curr_ang = 0.617517 | ang = 0.617574
Distance = 0.0110912
Curr_ang = 0.61752 | ang = 0.617531
Distance = 0.0109133
Curr_ang = 0.617521 | ang = 0.617527
Distance = 0.0107397
Curr_ang = 0.617521 | ang = 0.617462
Distance = 0.0105672
Curr_ang = 0.617518 | ang = 0.617543
Distance = 0.0103989
Curr_ang = 0.617519 | ang = 0.617563
Distance = 0.0102322
Curr_ang = 0.617522 | ang = 0.617476
Distance = 0.0100681
Curr_ang = 0.617519 | ang = 0.617431
Distance = 0.00990781
Mission Completed
Please enter new coordinates
Please enter goal_x:

基于MSRDS机器人仿真平台的多机器人PID编队控制算法

bug点解决的办法如上这篇。

简单试一试看能不能复现出bug。

不能达到目标点,高速暴冲!!!复现1

cocube稳定到失控

不能达到目标点,高速振荡!!!复现2

cocube稳定到振荡

不用再复现了,就是个~垃~圾~代码啊……

就这么一个简单的小程序,就能出现如此严重的bug。

测试是非常重要的,并且不可缺少!


创建文件move.cpp(或想要的任何名称)并将其粘贴到源目录中。
了解代码
TurtleBot类
TurtleBot类将包含机器人的所有方面,例如位置姿态、发布者和订阅者、订阅者回调函数和“移动到目标”函数。
订阅者
订阅者将订阅主题“/turtle1/pose”,这是发布实际机器人位置的主题。当收到消息时调用函数update_pose,并将实际位置保存在名为pose的类属性中。
欧氏位置法
该方法将使用先前保存的海龟位置(即自身位置姿势)和参数(即数据)来计算海龟和目标之间的点对点(欧几里得)距离。
比例控制器
为了让机器人移动,将对线速度和角速度使用比例控制。线性速度将由常数乘以机器人和目标位置之间的距离组成,角速度将取决于y轴距离的反正切乘以x轴距离乘以常数。
误差容忍度
必须在=目标点周围创建一个公差区,因为精确达到目标需要非常高的精度。在这段代码中,如果使用一个非常小的精度,海龟会发疯(你可以试试!)。换句话说,代码和模拟器被简化了,所以它不能以完全精确的方式工作。


参考案例Python PID:

#!/usr/bin/env python
import rospy
from geometry_msgs.msg  import Twist
from turtlesim.msg import Pose
from math import pow,atan2,sqrt
PI = 3.1415926535897

# PID parameters for rotation
p_r = 3
i_r = 0.00001
d_r = 1

# PID parameters for translation
p_t = 1.3
i_t = 0.0001
d_t = 1
class turtlebot():

    def __init__(self):
        #Creating our node,publisher and subscriber
        rospy.init_node('turtlebot_controller', anonymous=True)
        self.velocity_publisher = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10)
        self.pose_subscriber = rospy.Subscriber('/turtle1/pose', Pose, self.callback)
        self.pose = Pose()
        self.rate = rospy.Rate(10)

    #Callback function implementing the pose value received
    def callback(self, data):
        self.pose = data
        self.pose.x = round(self.pose.x, 4)
        self.pose.y = round(self.pose.y, 4)
       

    def get_distance(self, goal_x, goal_y):
        distance = sqrt(pow((goal_x - self.pose.x), 2) + pow((goal_y - self.pose.y), 2))
        return distance

    def move2goal(self):
        goal_pose = Pose()
        goal_pose.x = input("Set your x goal:")
        goal_pose.y = input("Set your y goal:")
	goal_theta = input("Set your theta goal:")
        distance_tolerance = input("Set your distance tolerance:")
        theta_tol = input("Set your theta tolerance:")

	while goal_theta > 360:
		goal_theta = goal_theta - 360
	
	# conerting angles from degrees to radians
	goal_pose.theta = goal_theta * PI / 180
	theta_tolerance = theta_tol * PI / 180
	 
        vel_msg = Twist()

	#PID Controller

	#rotate delta_1
	e_theta1_old = 0
	ei_theta1 = 0
	while abs(atan2(goal_pose.y - self.pose.y, goal_pose.x - self.pose.x) - self.pose.theta) >= theta_tolerance:
	    en_theta1 = atan2(goal_pose.y - self.pose.y, goal_pose.x - self.pose.x) - self.pose.theta
	    ed_theta1 = en_theta1 - e_theta1_old
	    ei_theta1 = ei_theta1 + en_theta1 
	    #linear velocity 
            vel_msg.linear.x = 0
            vel_msg.linear.y = 0
            vel_msg.linear.z = 0

            #angular velocity in the z-axis:
            vel_msg.angular.x = 0
            vel_msg.angular.y = 0
            vel_msg.angular.z = p_r * en_theta1 + i_r * ei_theta1 + d_r * ed_theta1

            #Publishing our vel_msg
            self.velocity_publisher.publish(vel_msg)
            self.rate.sleep()
	    
	    e_theta1_old = en_theta1
        #Stopping our robot after the movement is over
        vel_msg.angular.z = 0
        self.velocity_publisher.publish(vel_msg)


	#delta translate
	e_translatn_old = 0
	ei_translatn = 0
        while sqrt(pow((goal_pose.x - self.pose.x), 2) + pow((goal_pose.y - self.pose.y), 2)) >= distance_tolerance:
	    en_translatn = sqrt(pow((goal_pose.x - self.pose.x), 2) + pow((goal_pose.y - self.pose.y), 2))
	    ed_translatn = en_translatn - e_translatn_old
	    ei_translatn = ei_translatn + en_translatn

            #linear velocity in the x-axis:
            vel_msg.linear.x = p_t * en_translatn + i_t * ei_translatn + d_t * ed_translatn
            vel_msg.linear.y = 0
            vel_msg.linear.z = 0

            #angular velocity in the z-axis:
            vel_msg.angular.x = 0
            vel_msg.angular.y = 0
            vel_msg.angular.z = 0

            #Publishing our vel_msg
            self.velocity_publisher.publish(vel_msg)
            self.rate.sleep()
	    e_translatn_old = en_translatn	    

        #Stopping our robot after the movement is over
        vel_msg.linear.x = 0
        self.velocity_publisher.publish(vel_msg)

	#delta rotation 2
	e_theta2_old = 0
	ei_theta2 = 0
	while abs(goal_pose.theta - self.pose.theta) >= theta_tolerance:
	    en_theta2 = goal_pose.theta - self.pose.theta
	    ed_theta2 = en_theta2 - e_theta2_old
	    ei_theta2 = ei_theta2 + en_theta2
	    
	    #linear velocity 
            vel_msg.linear.x = 0
            vel_msg.linear.y = 0
            vel_msg.linear.z = 0

            #angular velocity in the z-axis:
            vel_msg.angular.x = 0
            vel_msg.angular.y = 0
            vel_msg.angular.z = p_r * en_theta2 + i_r * ei_theta2 + d_r * ed_theta2

            #Publishing our vel_msg
            self.velocity_publisher.publish(vel_msg)
            self.rate.sleep()
	    e_theta2_old = en_theta2
        #Stopping our robot after the movement is over
        vel_msg.angular.z = 0
        self.velocity_publisher.publish(vel_msg)

        rospy.spin()

if __name__ == '__main__':
    try:
        #Testing our function
        x = turtlebot()
        x.move2goal()

    except rospy.ROSInterruptException: pass

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

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

相关文章

JSON数据交互方式

目录 一、JSON的特点 二、前后端开发推荐使用工具ApiPost 扩展&#xff1a;xml与json的区别 三、JSON语法格式 语法注意点&#xff1a; 四、在html中定义json数据类型 1.单个实体——>JSON数据 2.数组实体——>JSON数据 3.集合实体——>JSON数据 五、JSON数据…

Redis的缓存穿透

文章目录1. 缓存穿透的理解2. 常见的解决方案有两种&#xff1a;3. 布隆过滤&#xff1a;4. 编码解决查询的缓存穿透问题&#xff1a;1. 缓存穿透的理解 缓存穿透是指客户端请求的数据在缓存中和数据库中都不存在&#xff0c;这样缓存永远不会生效&#xff0c;这些请求都会打到…

安科瑞企业微电网AcrelEMS-MED医院能效管理平台应用分析

安科瑞 李亚俊 平台概述 AcrelEMS-MED医院能效管理平台依据《医疗建筑电气设计规范》《绿色医院建筑评价标准》、《医院建筑能耗监管系统建设技术导则》等行业规范建设&#xff0c;由电力监控及能效管理系统组成&#xff0c;涵盖了医院中压变配电系统、应急电源、隔离电源、照…

刷题11-和大于或等于K的最短子数组

刷题008-和大于或等于K的最短子数组 首先&#xff0c;审题要认真&#xff0c;题目说的是>target的长度最小的连续子数组&#xff0c;也就是返回值最小为0&#xff0c;其次是1 核心思想&#xff1a;设置两个指针left和right&#xff0c;初始都指向0&#xff0c;当sum<ta…

java学习day60(乐友商城)搭建后台、使用nginx进行反向代理、实现查询功能

1.搭建后台管理前端 1.1.导入已有资源 后台项目相对复杂&#xff0c;为了有利于教学&#xff0c;我们不再从0搭建项目&#xff0c;而是直接使用课前资料中给大家准备好的源码&#xff1a; 我们解压缩&#xff0c;放到工作目录中&#xff1a; 然后在Intellij idea中导入新的工…

(一)RT-Thread入门——内核介绍

目录 内核介绍 线程调度 时钟管理 线程间同步 线程间通信 内存管理 I/O 设备管理 总结 今天就开始学习有关RT-Thread的相关知识了&#xff0c;准备理论和实践同时进行&#xff0c;目前这一部分是原理理论部分&#xff0c;后面会结合实际的例子来加强学习&#xff0c;系…

Kubernetes 平台的生态系统介绍

Kubernetes作为一个容器云管理平台&#xff0c;与底层的基础架构、企业周边的公共服务形成了一个完备的生态系统。如图1所示&#xff0c;一个完备的Kubernetes系统在设计和实现时&#xff0c;需要考虑多层面的高可用性问题。 图1 Kubernetes 平台的生态系统因此&#xff0c;解…

一、计算机网络体系结构(二)参考模型

目录 2.1计算机网络分层结构 2.2协议、接口、服务的概念 2.2.1语法、语义和同步 2.2.2服务访问点&#xff08;SAP&#xff09; 2.2.3服务 2.3ISO/OSI参考模型和TCP/IP模型 2.3.1常见的三种参考模型 2.3.2 OSI参考模型 2.3.3 TCP/IP参考模型 2.1计算机网络分层结构 …

第13章 用户角色服务实现

013 Permissions、RoutePrefix、RedisMqKey、CustomApiVersion、SwaggerSetup Permissions&#xff1a;通过该类中的属性成员&#xff0c;当前程序的权限配置提供数据支撑。 RoutePrefix&#xff1a;通过该类中的属性成员&#xff0c;为Swagger JSON设定终结点&#xff0c;为“…

混入mixin

混入(mixin)&#xff1a; 混入 (mixin) 提供了一种非常灵活的方式&#xff0c;来分发 Vue 组件中的 可复用功能 -- &#xff08;混入对象可以封装在一个组件中&#xff0c;以供复用&#xff0c;放的都是一些公共使用的功能。&#xff09;一个混入对象可以包含任意组件选项。当…

ELK 企业级日志分析系统及Logstash过滤模块

目录 一、ELK 简介 1.1 ELK各组件介绍 ElasticSearch&#xff1a; Kiabana&#xff1a; Logstash&#xff1a; 1.2 可以添加的其它组件&#xff1a; Filebeat&#xff1a; 缓存/消息队列&#xff08;redis、kafka、RabbitMQ等&#xff09;&#xff1a; Fluentd&#x…

authorization server client resource 使用2

authorization server && client && resource 使用2 oauth2 整合 jwt authorization server && client && resource 使用1 中默认的示例就是使用的jwt 生成token&#xff08;用于&#xff09;,当然这里和我们用户登录的token是有区别的 oau…

【信息奥赛题解】昆虫繁殖(详细分析题解 C++ 代码)

昆虫繁殖问题 &#x1f31f; 【题目名称】昆虫繁殖 【题目描述】 科学家在热带森林中发现了一种特殊的昆虫&#xff0c;这种昆虫的繁殖能力很强。每对成虫过 XXX 个月后开始产卵&#xff0c;每月产 YYY 对卵&#xff0c;每对卵要过两个月长成成虫。 假设每个成虫不死&#…

SpringCloud01:回顾微服务和微服务架构

回顾微服务和微服务架构微服务微服务架构微服务架构技术栈微服务 微服务架构 微服务架构的四个核心问题 服务很多&#xff0c;客户端怎么访问&#xff1f;这么多服务&#xff0c;服务之间如何通信&#xff1f;这么多服务&#xff0c;如何治理&#xff1f;服务挂了怎么办&#x…

selenium开启Google持久化调试

google selenium调试 需要下载和自己浏览器版本相匹配的版本 这里用google浏览器演示 查看浏览器版本 google浏览器通过在搜索栏输入如下内容查看 chrome://settings/helpchromedriver 下载 到如下任意链接下载对应的版本 CNPM Binaries Mirror http://chromedriver.sto…

#pragma pack(n)内存对齐

1. 为什么要对齐&#xff1f; #pragma pack主要是用在字节对齐方面&#xff0c;为什么要对齐呢&#xff1f; 因为计算机中内存空间都是按照byte划分的&#xff0c;从理论上讲似乎对任何类型的变量的访问可以从任何地址开始&#xff0c;但实际情况是在访问特定变量的时候经常在…

chatGPT非常重要的能力居然不行,就让这个工具来拯救,让你SQL操作无忧

引言 各位好&#xff0c;相信看见这篇文章的朋友&#xff0c;应该也去体验过了chatGPT了吧~&#xff0c;确实chatGPT拉近了我们与未来科技的距离&#xff0c;所有别人火也是非常有道理的&#xff0c;为其点赞。 本文主要是关注chatGPT的SQL能力&#xff1b;因为本人从事IT教育…

用友T+数据备份与恢复方法汇总

一、正常数据备份与恢复 适合于用友T能正常登陆、正常备份的情况。 1、数据备份 以系统管理员admin登陆系统管理&#xff0c;点击“账套维护”&#xff0c;选择好需要备份的账套&#xff0c;点击“备份”&#xff0c;同时设置好备份路径&#xff0c;保存备份文件即可&#xf…

(附源码)Springboot服装网购网站 毕业设计 010234

Springboot服装网购网站 摘 要 21世纪的今天&#xff0c;随着社会的不断发展与进步&#xff0c;人们对于信息科学化的认识&#xff0c;已由低层次向高层次发展&#xff0c;由原来的感性认识向理性认识提高&#xff0c;管理工作的重要性已逐渐被人们所认识&#xff0c;科学化的管…

Day825.死锁问题 -Java 并发编程实战

死锁问题 Hi&#xff0c;我是阿昌&#xff0c;今天学习记录的是关于死锁问题。 用 Account.class 作为互斥锁&#xff0c;来解决银行业务里面的转账问题&#xff0c;虽然这个方案不存在并发问题&#xff0c;但是所有账户的转账操作都是串行的&#xff0c;例如账户 A 转账户 B…