V-REP和Python的联合仿真

2023-11-07 13:44
文章标签 python 联合 仿真 rep

本文主要是介绍V-REP和Python的联合仿真,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

机器人仿真软件 各类免费的的机器人仿真软件优缺点汇总_robot 仿真 软件收费么_dyannacon的博客-CSDN博客

课程地址 https://class.guyuehome.com/p/t_pc/course_pc_detail/column/p_605af87be4b007b4183a42e7

课程资料 guyueclass: 古月学院课程代码

旋转变换 旋转的左乘与右乘 - 知乎

四足机器人站立控制原理 【基础知识】四足机器人的站立姿态控制原理 - 知乎

单腿逆解参考 https://github.com/richardbloemenkamp/Robotdog

Vrep文档

Vrep放大object

Vrep 导入模型步骤:

1. plugins-->urdf import导入机器人URDF文件

2. 删除机器人对象中的world_joint和world_link_visual

3. 双击设置机器人参数

碰撞参数设置:body参数设置,自身碰撞勾选前四个勾,leg参数设置,自身碰撞勾选后四个勾,即不计算与自身的碰撞关系

设置关节参数

调节颜色

python联合仿真

remote API路径:C:\Program Files\CoppeliaRobotics\CoppeliaSimEdu\programming\remoteApiBindings

1. 选择仿真器

2. 创建Vrep脚本用于远程连接

3. 绑定脚本到机器人

4. 编辑脚本,添加远程连接代码

4. 编写python脚本并测试(将腿部足端位置转换为关节的角度)

连接V-REP需要从remote API路径拷贝相关文件

"""
连接VREP Server并测试控制四足机器人
"""
try:import sim
except ImportError:print('--------------------------------------------------------------')print('"sim.py" could not be imported. This means very probably that')print('either "sim.py" or the remoteApi library could not be found.')print('Make sure both are in the same folder as this file,')print('or appropriately adjust the file "sim.py"')print('--------------------------------------------------------------')print('')sim = Noneimport time
import numpy as npdef start_simulation():sim.simxFinish(-1)# 开启套接字与server进行通信clientID = sim.simxStart('127.0.0.1', 19999, True, True, 5000, 5)if clientID != -1:print('Connected to remote API server with ClientID ', clientID)# 开始模拟sim.simxStartSimulation(clientID, sim.simx_opmode_oneshot)return clientIDelse:return -1def get_joints(client_id):# 机器人电机力矩参数rotation_forces = [# RB[500, 500, 500],# RF[500, 500, 500],# LB[500, 500, 500],# LF[500, 500, 500]]# 获取机器人关节对象句柄rec, rb_rot_1 = sim.simxGetObjectHandle(client_id, 'rb_rot_1', sim.simx_opmode_blocking)rec, rb_rot_2 = sim.simxGetObjectHandle(client_id, 'rb_rot_2', sim.simx_opmode_blocking)rec, rb_rot_3 = sim.simxGetObjectHandle(client_id, 'rb_rot_3', sim.simx_opmode_blocking)rec, rf_rot_1 = sim.simxGetObjectHandle(client_id, 'rf_rot_1', sim.simx_opmode_blocking)rec, rf_rot_2 = sim.simxGetObjectHandle(client_id, 'rf_rot_2', sim.simx_opmode_blocking)rec, rf_rot_3 = sim.simxGetObjectHandle(client_id, 'rf_rot_3', sim.simx_opmode_blocking)rec, lb_rot_1 = sim.simxGetObjectHandle(client_id, 'lb_rot_1', sim.simx_opmode_blocking)rec, lb_rot_2 = sim.simxGetObjectHandle(client_id, 'lb_rot_2', sim.simx_opmode_blocking)rec, lb_rot_3 = sim.simxGetObjectHandle(client_id, 'lb_rot_3', sim.simx_opmode_blocking)rec, lf_rot_1 = sim.simxGetObjectHandle(client_id, 'lf_rot_1', sim.simx_opmode_blocking)rec, lf_rot_2 = sim.simxGetObjectHandle(client_id, 'lf_rot_2', sim.simx_opmode_blocking)rec, lf_rot_3 = sim.simxGetObjectHandle(client_id, 'lf_rot_3', sim.simx_opmode_blocking)# 设置电机力矩rec = sim.simxSetJointForce(client_id, rb_rot_1, rotation_forces[0][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rb_rot_2, rotation_forces[0][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rb_rot_3, rotation_forces[0][2], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rf_rot_1, rotation_forces[1][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rf_rot_2, rotation_forces[1][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rf_rot_3, rotation_forces[1][2], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lb_rot_1, rotation_forces[2][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lb_rot_2, rotation_forces[2][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lb_rot_3, rotation_forces[2][2], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lf_rot_1, rotation_forces[3][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lf_rot_2, rotation_forces[3][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lf_rot_3, rotation_forces[3][2], sim.simx_opmode_blocking)return [rb_rot_1, rb_rot_2, rb_rot_3], \[rf_rot_1, rf_rot_2, rf_rot_3], \[lb_rot_1, lb_rot_2, lb_rot_3], \[lf_rot_1, lf_rot_2, lf_rot_3]def leg_inverse_kine(x, y, z):# h,hu和hl分别是单条腿杆件的长度h = 0.15hu = 0.35hl = 0.382dyz = np.sqrt(y**2 + z**2)lyz = np.sqrt(dyz**2 - h**2)gamma_yz = -np.arctan(y/z)gamma_h_offset = -np.arctan(h/lyz)gamma = gamma_yz - gamma_h_offsetlxzp = np.sqrt(lyz**2 + x**2)n = (lxzp**2 - hl**2 - hu**2) / (2 * hu)beta = -np.arccos(n / hl)alfa_xzp = -np.arctan(x/lyz)alfa_off = np.arccos((hu + n) / lxzp)alfa = alfa_xzp + alfa_offreturn gamma, alfa, betaif __name__ == '__main__':# 机器人电机角度参数rb_poses = [40*np.pi/180, 0, 0]rf_poses = [0, 0, 0]lb_poses = [0, 0, 0]lf_poses = [0, 0, 0]client_id = start_simulation()if client_id != -1:joints = get_joints(client_id)rb_joints = joints[0]rf_joints = joints[1]lb_joints = joints[2]lf_joints = joints[3]time.sleep(1)timeout = 60start_time = time.time()curr_time = time.time()# 初始关节角度rb_poses = leg_inverse_kine(0, -0.3, -0.632)rf_poses = leg_inverse_kine(0, -0.3, -0.632)lb_poses = leg_inverse_kine(0, -0.3, -0.632)lf_poses = leg_inverse_kine(0, -0.3, -0.632)while curr_time - start_time < timeout:# 设置关节角度rec = sim.simxSetJointTargetPosition(client_id, rb_joints[0], -rb_poses[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, rb_joints[1], rb_poses[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, rb_joints[2], rb_poses[2], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, rf_joints[0], rf_poses[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, rf_joints[1], rf_poses[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, rf_joints[2], rf_poses[2], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, lb_joints[0], -lb_poses[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, lb_joints[1], lb_poses[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, lb_joints[2], lb_poses[2], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, lf_joints[0], lf_poses[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, lf_joints[1], lf_poses[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(client_id, lf_joints[2], lf_poses[2], sim.simx_opmode_oneshot)curr_time = time.time()# print("curr time :", curr_time - start_time)# 完成模拟sim.simxStopSimulation(client_id, sim.simx_opmode_blocking)sim.simxFinish(client_id)else:print('Failed connecting to remote API server')

显示足端轨迹

1. 打开shape编辑模式,并在vertex编辑模式下选择节点,在添加dummy

将dummy移动到腿部object下

2. 添加图用于创建curve

3. 设置3D Curve

4. 修改位置控制速度上限(将速度上限修改为500)

步态控制

utils.py

import sim
import numpy as npdef start_simulation():sim.simxFinish(-1)# 开启套接字与server进行通信clientID = sim.simxStart('127.0.0.1', 19999, True, True, 5000, 5)if clientID != -1:print('Connected to remote API server with ClientID ', clientID)# 开始模拟sim.simxStartSimulation(clientID, sim.simx_opmode_oneshot)return clientIDelse:return -1def get_joints(client_id):# 机器人电机力矩参数rotation_forces = [# RB[500, 500, 500],# RF[500, 500, 500],# LB[500, 500, 500],# LF[500, 500, 500]]# 获取机器人关节对象句柄rec, rb_rot_1 = sim.simxGetObjectHandle(client_id, 'rb_rot_1', sim.simx_opmode_blocking)rec, rb_rot_2 = sim.simxGetObjectHandle(client_id, 'rb_rot_2', sim.simx_opmode_blocking)rec, rb_rot_3 = sim.simxGetObjectHandle(client_id, 'rb_rot_3', sim.simx_opmode_blocking)rec, rf_rot_1 = sim.simxGetObjectHandle(client_id, 'rf_rot_1', sim.simx_opmode_blocking)rec, rf_rot_2 = sim.simxGetObjectHandle(client_id, 'rf_rot_2', sim.simx_opmode_blocking)rec, rf_rot_3 = sim.simxGetObjectHandle(client_id, 'rf_rot_3', sim.simx_opmode_blocking)rec, lb_rot_1 = sim.simxGetObjectHandle(client_id, 'lb_rot_1', sim.simx_opmode_blocking)rec, lb_rot_2 = sim.simxGetObjectHandle(client_id, 'lb_rot_2', sim.simx_opmode_blocking)rec, lb_rot_3 = sim.simxGetObjectHandle(client_id, 'lb_rot_3', sim.simx_opmode_blocking)rec, lf_rot_1 = sim.simxGetObjectHandle(client_id, 'lf_rot_1', sim.simx_opmode_blocking)rec, lf_rot_2 = sim.simxGetObjectHandle(client_id, 'lf_rot_2', sim.simx_opmode_blocking)rec, lf_rot_3 = sim.simxGetObjectHandle(client_id, 'lf_rot_3', sim.simx_opmode_blocking)# 设置电机力矩rec = sim.simxSetJointForce(client_id, rb_rot_1, rotation_forces[0][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rb_rot_2, rotation_forces[0][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rb_rot_3, rotation_forces[0][2], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rf_rot_1, rotation_forces[1][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rf_rot_2, rotation_forces[1][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, rf_rot_3, rotation_forces[1][2], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lb_rot_1, rotation_forces[2][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lb_rot_2, rotation_forces[2][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lb_rot_3, rotation_forces[2][2], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lf_rot_1, rotation_forces[3][0], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lf_rot_2, rotation_forces[3][1], sim.simx_opmode_blocking)rec = sim.simxSetJointForce(client_id, lf_rot_3, rotation_forces[3][2], sim.simx_opmode_blocking)return [rb_rot_1, rb_rot_2, rb_rot_3], \[rf_rot_1, rf_rot_2, rf_rot_3], \[lb_rot_1, lb_rot_2, lb_rot_3], \[lf_rot_1, lf_rot_2, lf_rot_3]def leg_inverse_kine(x, y, z):"""求四足机器人单条腿的逆运动学,输入足端位置,返回单腿关节的旋转的角度"""# h,hu和hl分别是单条腿杆件的长度h = 0.15hu = 0.35hl = 0.382dyz = np.sqrt(y ** 2 + z ** 2)lyz = np.sqrt(dyz ** 2 - h ** 2)gamma_yz = -np.arctan(y / z)gamma_h_offset = -np.arctan(h / lyz)gamma = gamma_yz - gamma_h_offsetlxzp = np.sqrt(lyz ** 2 + x ** 2)n = (lxzp ** 2 - hl ** 2 - hu ** 2) / (2 * hu)beta = -np.arccos(n / hl)alfa_xzp = -np.arctan(x / lyz)alfa_off = np.arccos((hu + n) / lxzp)alfa = alfa_xzp + alfa_offreturn gamma, alfa, betadef pose_control(roll, pitch, yaw, pos_x, pos_y, pos_z):"""输入"""b = 0.4l = 0.8w = 0.7# 基座的高度h = 0.732# 转换角度R = roll * np.pi / 180P = pitch * np.pi / 180Y = yaw * np.pi / 180pos = np.mat([pos_x, pos_y, pos_z]).T# 定义旋转矩阵rotx = np.mat([[1, 0, 0],[0, np.cos(R), -np.sin(R)],[0, np.sin(R), np.cos(R)]])roty = np.mat([[np.cos(P), 0, -np.sin(P)],[0, 1, 0],[np.sin(P), 0, np.cos(P)]])rotz = np.mat([[np.cos(Y), -np.sin(Y), 0],[np.sin(Y), np.cos(Y), 0],[0, 0, 1]])rot_mat = rotx * roty * rotz# 基座位置body_struct = np.mat([[l / 2, b / 2, h],[l / 2, -b / 2, h],[-l / 2, b / 2, h],[-l / 2, -b / 2, h]]).T# 足端位置footpoint_struct = np.mat([[l / 2, w / 2, 0],[l / 2, -w / 2, 0],[-l / 2, w / 2, 0],[-l / 2, -w / 2, 0]]).Tleg_pose = np.mat(np.zeros((3, 4)))for i in range(4):leg_pose[:, i] = -pos - rot_mat * body_struct[:, i] + footpoint_struct[:, i]return np.squeeze(np.array(leg_pose[:, 3])), np.squeeze(np.array(leg_pose[:, 0])), \np.squeeze(np.array(leg_pose[:, 1])), np.squeeze(np.array(leg_pose[:, 2]))def cycloid(dt: float, period: float = 1.0, xs: float = -0.1, xf: float = 0.1, zs: float = -0.582, h: float = 0.1):"""计算摆线上在给定时间t处的坐标。参数:t (float): 当前时间点Ts (float): 摆线运动总时间,默认为1.0xs (float): 起始x坐标,默认为-0.1xf (float): 终点x坐标,默认为0.1zs (float): 起始z坐标,默认为-0.582h (float): 摆线垂直位移,默认为0.1返回:tuple[float, float]: xep和zep的坐标值"""sigma = 2 * np.pi * dt / periodx_p = (xf - xs) * ((sigma - np.sin(sigma)) / (2 * np.pi)) + xsy_p = h * (1 - np.cos(sigma)) / 2 + zsreturn x_p, y_pif __name__ == '__main__':for pos in pose_control(30, 0, 0, 0, 0, 0.732):print(pos)

main.py

import time
from utils import *walk_period = 1.0
trot_period = 0.4gait = 1def cal_phase(dt, T, factor, zs = -0.482, h = 0.15):if dt < T * factor:return cycloid(dt, period=T * factor, zs=zs, h=h)else:return 0.1 - 0.2 / (T * (1 - factor)) * (dt - T * factor), zsdef walk_gait(dt):zs = -0.482h = 0.15lb_dt = dt % walk_periodrf_dt = (dt + 0.25) % walk_periodrb_dt = (dt + 0.5) % walk_periodlf_dt = (dt + 0.75) % walk_periodlb_pos = cal_phase(lb_dt, T=walk_period, factor=0.25, zs=zs, h=h)rf_pos = cal_phase(rf_dt, T=walk_period, factor=0.25, zs=zs, h=h)rb_pos = cal_phase(rb_dt, T=walk_period, factor=0.25, zs=zs, h=h)lf_pos = cal_phase(lf_dt, T=walk_period, factor=0.25, zs=zs, h=h)return lb_pos, rf_pos, rb_pos, lf_posdef trot_gait(dt):zs = -0.482h = 0.1dt_1 = dt % trot_perioddt_2 = (dt + 0.2) % trot_periodpos_1 = cal_phase(dt_1, T=trot_period, factor=0.5, zs=zs, h=h)pos_2 = cal_phase(dt_2, T=trot_period, factor=0.5, zs=zs, h=h)return pos_1, pos_2if __name__ == '__main__':# 连接到V-REP服务器clientID = start_simulation()# 检查连接是否成功if clientID != -1:joints = get_joints(clientID)rb_joints = joints[0]rf_joints = joints[1]lb_joints = joints[2]lf_joints = joints[3]timeout = 60start_time = time.time()curr_time = start_timesim_start_time, sim_curr_time = None, Nonelb_pos, rf_pos, rb_pos, lf_pos = None, None, None, None# 获取仿真时间while curr_time - start_time < timeout:res, sim_curr_time = sim.simxGetFloatSignal(clientID, 'time', sim.simx_opmode_oneshot)if res == sim.simx_return_ok:if sim_start_time is None:sim_start_time = sim_curr_timeprint("time ", sim_curr_time - sim_start_time)if sim_start_time:dt = sim_curr_time - sim_start_timeif gait == 0:# dt = (sim_curr_time - sim_start_time) % walk_periodlb_pos, rf_pos, rb_pos, lf_pos = walk_gait(dt)elif gait == 1:# dt = (sim_curr_time - sim_start_time) % trot_periodpos_1, pos_2 = trot_gait(dt)lb_pos = pos_1rf_pos = pos_1rb_pos = pos_2lf_pos = pos_2# 从足端位置求解关节角度rb_pose = leg_inverse_kine(rb_pos[0], -0.15, rb_pos[1])rf_pose = leg_inverse_kine(rf_pos[0], -0.15, rf_pos[1])lb_pose = leg_inverse_kine(lb_pos[0], -0.15, lb_pos[1])lf_pose = leg_inverse_kine(lf_pos[0], -0.15, lf_pos[1])rec = sim.simxSetJointTargetPosition(clientID, rb_joints[0], -rb_pose[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, rb_joints[1], rb_pose[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, rb_joints[2], rb_pose[2], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, rf_joints[0], rf_pose[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, rf_joints[1], rf_pose[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, rf_joints[2], rf_pose[2], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, lb_joints[0], -lb_pose[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, lb_joints[1], lb_pose[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, lb_joints[2], lb_pose[2], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, lf_joints[0], lf_pose[0], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, lf_joints[1], lf_pose[1], sim.simx_opmode_oneshot)rec = sim.simxSetJointTargetPosition(clientID, lf_joints[2], lf_pose[2], sim.simx_opmode_oneshot)# 停止仿真并断开与V-REP的连接sim.simxStopSimulation(clientID, sim.simx_opmode_oneshot)sim.simxFinish(clientID)else:print("无法连接到V-REP")

walk步态

trot步态

这篇关于V-REP和Python的联合仿真的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/364005

相关文章

使用Python绘制蛇年春节祝福艺术图

《使用Python绘制蛇年春节祝福艺术图》:本文主要介绍如何使用Python的Matplotlib库绘制一幅富有创意的“蛇年有福”艺术图,这幅图结合了数字,蛇形,花朵等装饰,需要的可以参考下... 目录1. 绘图的基本概念2. 准备工作3. 实现代码解析3.1 设置绘图画布3.2 绘制数字“2025”3.3

python使用watchdog实现文件资源监控

《python使用watchdog实现文件资源监控》watchdog支持跨平台文件资源监控,可以检测指定文件夹下文件及文件夹变动,下面我们来看看Python如何使用watchdog实现文件资源监控吧... python文件监控库watchdogs简介随着Python在各种应用领域中的广泛使用,其生态环境也

Python中构建终端应用界面利器Blessed模块的使用

《Python中构建终端应用界面利器Blessed模块的使用》Blessed库作为一个轻量级且功能强大的解决方案,开始在开发者中赢得口碑,今天,我们就一起来探索一下它是如何让终端UI开发变得轻松而高... 目录一、安装与配置:简单、快速、无障碍二、基本功能:从彩色文本到动态交互1. 显示基本内容2. 创建链

Java调用Python代码的几种方法小结

《Java调用Python代码的几种方法小结》Python语言有丰富的系统管理、数据处理、统计类软件包,因此从java应用中调用Python代码的需求很常见、实用,本文介绍几种方法从java调用Pyt... 目录引言Java core使用ProcessBuilder使用Java脚本引擎总结引言python

python 字典d[k]中key不存在的解决方案

《python字典d[k]中key不存在的解决方案》本文主要介绍了在Python中处理字典键不存在时获取默认值的两种方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,... 目录defaultdict:处理找不到的键的一个选择特殊方法__missing__有时候为了方便起见,

使用Python绘制可爱的招财猫

《使用Python绘制可爱的招财猫》招财猫,也被称为“幸运猫”,是一种象征财富和好运的吉祥物,经常出现在亚洲文化的商店、餐厅和家庭中,今天,我将带你用Python和matplotlib库从零开始绘制一... 目录1. 为什么选择用 python 绘制?2. 绘图的基本概念3. 实现代码解析3.1 设置绘图画

Python pyinstaller实现图形化打包工具

《Pythonpyinstaller实现图形化打包工具》:本文主要介绍一个使用PythonPYQT5制作的关于pyinstaller打包工具,代替传统的cmd黑窗口模式打包页面,实现更快捷方便的... 目录1.简介2.运行效果3.相关源码1.简介一个使用python PYQT5制作的关于pyinstall

使用Python实现大文件切片上传及断点续传的方法

《使用Python实现大文件切片上传及断点续传的方法》本文介绍了使用Python实现大文件切片上传及断点续传的方法,包括功能模块划分(获取上传文件接口状态、临时文件夹状态信息、切片上传、切片合并)、整... 目录概要整体架构流程技术细节获取上传文件状态接口获取临时文件夹状态信息接口切片上传功能文件合并功能小

python实现自动登录12306自动抢票功能

《python实现自动登录12306自动抢票功能》随着互联网技术的发展,越来越多的人选择通过网络平台购票,特别是在中国,12306作为官方火车票预订平台,承担了巨大的访问量,对于热门线路或者节假日出行... 目录一、遇到的问题?二、改进三、进阶–展望总结一、遇到的问题?1.url-正确的表头:就是首先ur

基于Python实现PDF动画翻页效果的阅读器

《基于Python实现PDF动画翻页效果的阅读器》在这篇博客中,我们将深入分析一个基于wxPython实现的PDF阅读器程序,该程序支持加载PDF文件并显示页面内容,同时支持页面切换动画效果,文中有详... 目录全部代码代码结构初始化 UI 界面加载 PDF 文件显示 PDF 页面页面切换动画运行效果总结主