ros1仿真导航机器人 基础传感器数据读取

news2024/10/5 15:27:35

仅为学习记录和一些自己的思考,不具有参考意义。

1 仿真环境

gazebo、rviz、ros1

2 机器人模型

<?xml version="1.0"?>
<robot name="wpb_home_gazebo">

<link name="base_footprint">
  <visual>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <geometry>
      <box size="0.05 0.05 0.001" />
    </geometry>
  </visual>
</link>

<joint name="base_joint" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 0" />
  <parent link="base_footprint"/>
  <child link="base_link" />
</joint>

<!-- base -->
<link name="base_link">
  <visual>
   <geometry>
    <box size="0.01 0.01 0.001" />
   </geometry>
   <origin rpy = "0 0 0" xyz = "0 0 0"/>
  </visual>
</link>

<!-- body -->
<link name = "body_link">
  <visual>
    <geometry>
      <mesh filename="package://why_simulation/meshes/wpb_home/wpb_home_std.dae" scale="1 1 1"/>
    </geometry>
    <origin rpy = "1.57 0 1.57" xyz = "-.225 -0.225 0"/>
  </visual>
  <collision>
    <origin xyz="0.001 0 .065" rpy="0 0 0" />
    <geometry>
      <cylinder length="0.13" radius="0.226"/>
    </geometry>
  </collision>
  <inertial>
    <mass value="20"/>
    <inertia ixx="4.00538" ixy="0.0" ixz="0.0" iyy="4.00538" iyz="0.0" izz="0.51076"/>
  </inertial>
</link>
<joint name = "base_to_body" type = "fixed">
  <parent link = "base_link"/>
  <child link = "body_link"/>
  <origin rpy="0 0 0" xyz="0 0 0"/> <!--pos-->
</joint>
<!-- top of base -->
<link name = "base_top_link">
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <geometry>
      <box size="0.33 0.31 0.01"/>
    </geometry>
  </collision>
  <inertial>
    <mass value="0.01"/>
    <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
  </inertial>
</link>
<joint name = "body_to_top" type = "fixed">
  <parent link = "body_link"/>
  <child link = "base_top_link"/>
  <origin rpy="0 0 0" xyz="0.01 0 0.2"/> <!--pos-->
</joint>
<!-- back -->
<link name = "body_back_link">
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <geometry>
      <box size="0.03 0.23 1.05"/>
    </geometry>
  </collision>
  <inertial>
    <mass value="0.01"/>
    <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
  </inertial>
</link>
<joint name = "body_to_back" type = "fixed">
  <parent link = "base_top_link"/>
  <child link = "body_back_link"/>
  <origin rpy="0 0.31 0" xyz="-0.038 0 0.5"/> <!--pos-->
</joint>
<!-- head -->
<link name = "head_link">
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <geometry>
      <box size="0.07 0.28  0.06"/>
    </geometry>
  </collision>
  <inertial>
    <mass value="0.01"/>
    <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
  </inertial>
</link>
<joint name = "body_to_head" type = "fixed">
  <parent link = "base_top_link"/>
  <child link = "head_link"/>
  <origin rpy="0 0.27 0" xyz="0.155 0 1.17"/> <!--pos-->
</joint>
<!-- front -->
<link name = "front_link">
  <collision>
    <origin xyz="0 0 0" rpy="0 0 0" />
    <geometry>
     <cylinder length="1.1" radius="0.01"/>
    </geometry>
  </collision>
  <inertial>
    <mass value="0.01"/>
    <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
  </inertial>
</link>
<joint name = "body_to_front" type = "fixed">
  <parent link = "base_top_link"/>
  <child link = "front_link"/>
  <origin rpy="0 0 0" xyz="0.15 0 0.55"/> <!--pos-->
</joint>

<!-- Lidar -->
<link name = "laser">
  <visual>
   <geometry>
      <cylinder length="0.001" radius="0.001"/>
   </geometry>
   <origin rpy = "0 0 0" xyz = "0 0 0"/>
  </visual>
</link>
<joint name="laser_joint" type="fixed">
    <origin rpy="0 0 0" xyz="0 0 0.15"  /> <!--pos-->
    <parent link="base_link" />
    <child link="laser" />
</joint>

<!-- Kinect -->
<link name = "kinect2_dock">
  <visual>
   <geometry>
    <!-- <box size=".01 .25 .07"/>-->
    <box size="0.001 0.001 0.001"/>
   </geometry>
   <origin rpy = "0 0 0" xyz = "0 0 0"/>
  </visual>
</link>
<joint name="kinect_height" type="fixed">
  <parent link="base_link"/>
  <child link="kinect2_dock"/>
  <origin xyz="0.145 -0.013 1.37" rpy="0 0 0"/> 
</joint>

<link name = "kinect2_head_frame">
  <visual>
   <geometry>
    <box size="0.001 0.001 0.001"/>
   </geometry>
   <origin xyz = "0 0 0" rpy = "0 0 0"/>
  </visual>
</link>
<!--kinect_pitch -->
<joint name="kinect_pitch" type="fixed">
  <origin xyz="0 0 0" rpy="0 0.5 0" /> 
  <parent link="kinect2_dock" />
  <child link="kinect2_head_frame" />
</joint>

<link name = "kinect2_front_frame">
  <visual>
   <geometry>
    <box size="0.001 0.001 0.001"/>
   </geometry>
   <origin xyz = "0 0 0" rpy = "0 0 0"/>
  </visual>
</link>
<joint name="kinect_head" type="fixed">
  <origin xyz="0 0 0" rpy=" 0 1.57 0" /> 
  <parent link="kinect2_head_frame" />
  <child link="kinect2_front_frame" />
</joint>
<link name = "kinect2_ir_optical_frame">
  <visual>
   <geometry>
    <!-- <box size=".25 .04 .07"/>-->
    <box size="0.001 0.001 0.001"/>
   </geometry>
   <origin xyz = "0 0 0" rpy = "0 0 0"/>
  </visual>
</link>
<joint name="kinect_ir_trans" type="fixed">
  <origin xyz="0 0 0" rpy="0 0 -1.57" /> 
  <parent link="kinect2_front_frame" />
  <child link="kinect2_ir_optical_frame" />
</joint>

<link name = "kinect2_camera_frame">
  <visual>
   <geometry>
    <box size="0.001 0.001 0.001"/>
   </geometry>
   <origin rpy = "0 0 0" xyz = "0 0 0" />
  </visual>
</link>
<joint name="kinect_camra_joint" type="fixed">
    <origin xyz="0 0 0" rpy="3.1415926 0 -1.5707963" />
    <parent link="kinect2_ir_optical_frame" />
    <child link="kinect2_camera_frame" />
</joint>

<link name = "kinect2_rgb_optical_frame">
  <visual>
   <geometry>
    <box size="0.001 0.001 0.001"/>
   </geometry>
   <origin rpy = "0 0 0" xyz = "0 0 0" />
  </visual>
</link>
<joint name="kinect_hd_joint" type="fixed">
    <origin xyz="0 0 0" rpy="0 1.5707963 0" />
    <parent link="kinect2_camera_frame" />
    <child link="kinect2_rgb_optical_frame" />
</joint>

<!-- Gazebo plugin for WPR -->
<gazebo>
  <plugin name="base_controller" filename="libwpr_plugin.so">
    <publishOdometryTf>true</publishOdometryTf>
    <commandTopic>cmd_vel</commandTopic>
    <odometryTopic>odom</odometryTopic>
    <odometryFrame>odom</odometryFrame>
    <odometryRate>20.0</odometryRate>
    <robotBaseFrame>base_footprint</robotBaseFrame>
  </plugin>
</gazebo>

<!-- Gazebo plugin for RpLidar A2 -->
<gazebo reference="laser">
  <sensor type="ray" name="rplidar_sensor">
    <pose>0 0 0.06 0 0 0</pose>
    <visualize>true</visualize>
    <update_rate>10</update_rate>
    <ray>
      <scan>
        <horizontal>
          <samples>360</samples>
          <resolution>1</resolution>
          <min_angle>-3.14159265</min_angle>
          <max_angle>3.14159265</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.24</min>
        <max>6.0</max>
        <resolution>0.01</resolution>
      </range>
      <noise>
        <type>gaussian</type>
        <mean>0.0</mean>
        <stddev>0.01</stddev>
      </noise>
    </ray>
    <plugin name="rplidar_ros_controller" filename="libgazebo_ros_laser.so">
      <topicName>scan</topicName>
      <frameName>laser</frameName>
    </plugin>
  </sensor>
</gazebo>

<!-- Gazebo plugin for Kinect v2 -->
<gazebo reference="kinect2_head_frame">
  <sensor type="depth" name="kinect2_depth_sensor" >
    <always_on>true</always_on>
    <update_rate>10.0</update_rate>
    <camera name="kinect2_depth_sensor">
      <horizontal_fov>1.221730456</horizontal_fov>
      <image>
          <width>512</width>
          <height>424</height>
          <format>B8G8R8</format>
      </image>
      <clip>
          <near>0.5</near>
          <far>6.0</far>
      </clip>
      <noise>
          <type>gaussian</type>
          <mean>0.1</mean>
          <stddev>0.07</stddev>
      </noise>
    </camera>
    <plugin name="kinect2_depth_control" filename="libgazebo_ros_openni_kinect.so">
        <cameraName>kinect2/sd</cameraName>
        <alwaysOn>true</alwaysOn>
        <updateRate>20.0</updateRate>
        <imageTopicName>image_ir_rect</imageTopicName>
        <depthImageTopicName>image_depth_rect</depthImageTopicName>
        <pointCloudTopicName>points</pointCloudTopicName>
        <cameraInfoTopicName>depth_camera_info</cameraInfoTopicName>
        <frameName>kinect2_ir_optical_frame</frameName>
        <pointCloudCutoff>0.5</pointCloudCutoff>
        <pointCloudCutoffMax>6.0</pointCloudCutoffMax>
        <baseline>0.1</baseline>
        <distortionK1>0.0</distortionK1>
        <distortionK2>0.0</distortionK2>
        <distortionK3>0.0</distortionK3>
        <distortionT1>0.0</distortionT1>
        <distortionT2>0.0</distortionT2>
    </plugin>
  </sensor>
</gazebo>
<gazebo reference="kinect2_rgb_optical_frame">
    <sensor type="camera" name="kinect2_rgb_sensor">
        <always_on>true</always_on>
        <update_rate>20.0</update_rate>
        <camera name="kinect2_rgb_sensor">
          <horizontal_fov>1.221730456</horizontal_fov>
          <image>
              <width>1920</width>
              <height>1080</height>
              <format>B8G8R8</format>
          </image>
          <clip>
              <near>0.2</near>
              <far>10.0</far>
          </clip>
          <noise>
              <type>gaussian</type>
              <mean>0.0</mean>
              <stddev>0.007</stddev>
          </noise>
        </camera>
        <plugin name="kinect2_rgb_controller" filename="libgazebo_ros_camera.so">
          <alwaysOn>true</alwaysOn>
          <update_rate>20.0</update_rate>
          <cameraName>kinect2/hd</cameraName>
          <imageTopicName>image_color_rect</imageTopicName>
          <cameraInfoTopicName>camera_info</cameraInfoTopicName>
          <frameName>kinect2_rgb_optical_frame</frameName>
        </plugin>
    </sensor>
</gazebo>

<gazebo reference="kinect2_head_frame">
    <sensor type="camera" name="kinect2_qhd_rgb_sensor">
        <always_on>true</always_on>
        <update_rate>20.0</update_rate>
        <camera name="kinect2_qhd_rgb_sensor">
          <horizontal_fov>1.221730456</horizontal_fov>
          <image>
              <width>960</width>
              <height>540</height>
              <format>R8G8B8</format>
          </image>
          <clip>
              <near>0.2</near>
              <far>10.0</far>
          </clip>
        </camera>
        <plugin name="kinect2_qhd_rgb_controller" filename="libgazebo_ros_camera.so">
          <alwaysOn>true</alwaysOn>
          <update_rate>20.0</update_rate>
          <cameraName>kinect2/qhd</cameraName>
          <imageTopicName>image_color_rect</imageTopicName>
          <cameraInfoTopicName>camera_info</cameraInfoTopicName>
          <frameName>kinect2_head_frame</frameName>
        </plugin>
    </sensor>
</gazebo>

<!-- IMU plugin for 'body_link' -->
<gazebo reference="body_link">
  <gravity>true</gravity>
  <sensor name="imu_sensor" type="imu">
    <always_on>true</always_on>
    <update_rate>100</update_rate>
    <visualize>true</visualize>
    <topic>__default_topic__</topic>
    <plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
      <topicName>imu/data</topicName>
      <bodyName>body_link</bodyName>
      <updateRateHZ>100.0</updateRateHZ>
      <gaussianNoise>0.0</gaussianNoise>
      <xyzOffset>0 0 0</xyzOffset>
      <rpyOffset>0 0 0</rpyOffset>
      <frameName>imu_link</frameName>
    </plugin>
    <pose>0 0 0 0 0 0</pose>
  </sensor>
</gazebo>

</robot>

3启动launch文件

roslaunch why_simulation why_simple.launch

<launch>
  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find why_simulation)/worlds/why_simple.world"/>
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="recording" value="false"/>
    <arg name="debug" value="false"/>
  </include>

  <!-- Spawn the objects into Gazebo -->
  <node name="bookshelft" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/bookshelft.model -x 3.0 -y 0.2 -z 0 -Y 3.14159 -urdf -model bookshelft" />
  <node name="bottle" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/bottles/red_bottle.model -x 2.8 -y 0 -z 0.6 -Y 0 -urdf -model red_bottle" />

  <!-- Spawn a robot into Gazebo -->
  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-file $(find why_simulation)/models/wpb_home.model -urdf -model wpb_home" />

  <!-- Robot Description -->
  <arg name="model" default="$(find why_simulation)/models/wpb_home.model"/>
  <param name="robot_description" command="$(find xacro)/xacro $(arg model)" />
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
</launch>

rviz

4Topic话题查看

rostopic list

/clock
/cmd_vel
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/imu/data
/joint_states
/kinect2/hd/camera_info
/kinect2/hd/image_color_rect
/kinect2/hd/image_color_rect/compressed
/kinect2/hd/image_color_rect/compressed/parameter_descriptions
/kinect2/hd/image_color_rect/compressed/parameter_updates
/kinect2/hd/image_color_rect/compressedDepth
/kinect2/hd/image_color_rect/compressedDepth/parameter_descriptions
/kinect2/hd/image_color_rect/compressedDepth/parameter_updates
/kinect2/hd/image_color_rect/theora
/kinect2/hd/image_color_rect/theora/parameter_descriptions
/kinect2/hd/image_color_rect/theora/parameter_updates
/kinect2/hd/parameter_descriptions
/kinect2/hd/parameter_updates
/kinect2/qhd/camera_info
/kinect2/qhd/image_color_rect
/kinect2/qhd/image_color_rect/compressed
/kinect2/qhd/image_color_rect/compressed/parameter_descriptions
/kinect2/qhd/image_color_rect/compressed/parameter_updates
/kinect2/qhd/image_color_rect/compressedDepth
/kinect2/qhd/image_color_rect/compressedDepth/parameter_descriptions
/kinect2/qhd/image_color_rect/compressedDepth/parameter_updates
/kinect2/qhd/image_color_rect/theora
/kinect2/qhd/image_color_rect/theora/parameter_descriptions
/kinect2/qhd/image_color_rect/theora/parameter_updates
/kinect2/qhd/parameter_descriptions
/kinect2/qhd/parameter_updates
/kinect2/sd/depth/camera_info
/kinect2/sd/depth_camera_info
/kinect2/sd/image_depth_rect
/kinect2/sd/image_ir_rect
/kinect2/sd/image_ir_rect/compressed
/kinect2/sd/image_ir_rect/compressed/parameter_descriptions
/kinect2/sd/image_ir_rect/compressed/parameter_updates
/kinect2/sd/image_ir_rect/compressedDepth
/kinect2/sd/image_ir_rect/compressedDepth/parameter_descriptions
/kinect2/sd/image_ir_rect/compressedDepth/parameter_updates
/kinect2/sd/image_ir_rect/theora
/kinect2/sd/image_ir_rect/theora/parameter_descriptions
/kinect2/sd/image_ir_rect/theora/parameter_updates
/kinect2/sd/parameter_descriptions
/kinect2/sd/parameter_updates
/kinect2/sd/points
/odom
/rosout
/rosout_agg
/scan
/tf
/tf_static

5运动控制与传感器数据读取

运动控制

rosrun why_test test_vel

#include <ros/ros.h>
#include <geometry_msgs/Twist.h>

int main(int argc, char  *argv[])
{
    ros::init(argc,argv,"test_vel");

    ros::NodeHandle nh;
    ros::Publisher pub_=nh.advertise<geometry_msgs::Twist>("/cmd_vel",10);

    ros::Rate rate(10);
    while (ros::ok())
    {
        auto twist=geometry_msgs::Twist();
        twist.linear.x=0.2;
        twist.angular.z=0.2;
        pub_.publish(twist);
        rate.sleep();
    }
    
    return 0;
}

激光雷达数据读取

rosrun why_test test_lidar

#include <ros/ros.h>
#include <sensor_msgs/LaserScan.h>


void LidarCallback(const sensor_msgs::LaserScan msg)
{
    float dMidDist=msg.ranges[180];
    std::cout<<"distance="<<dMidDist<<std::endl;
}



int main(int argc, char *argv[])
{
    ros::init(argc,argv,"test_lidar");

    ros::NodeHandle nh;
    ros::Subscriber sub_=nh.subscribe("/scan",10,&LidarCallback);

    ros::spin();

    return 0;
}

IMU数据读取

rosrun why_test test_imu

#include "ros/ros.h"
#include "sensor_msgs/Imu.h"
#include "tf/tf.h"


void IMUCallback(const sensor_msgs::Imu msg)
{
    if(msg.orientation_covariance[0] < 0)
        return;

    tf::Quaternion quaternion(
        msg.orientation.x,
        msg.orientation.y,
        msg.orientation.z,
        msg.orientation.w
    );
    double roll, pitch, yaw;
    tf::Matrix3x3(quaternion).getRPY(roll, pitch, yaw);

    roll = roll*180/M_PI;
    pitch = pitch*180/M_PI;
    yaw = yaw*180/M_PI;
    ROS_INFO("roll= %.0f pitch= %.0f yaw= %.0f", roll, pitch, yaw);
}

int main(int argc, char **argv)
{
    ros::init(argc,argv, "test_imu"); 

    ros::NodeHandle n;

    ros::Subscriber sub = n.subscribe("imu/data", 100, IMUCallback);

    ros::spin();

    return 0;
}

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

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

相关文章

第6章_libmodbus使用

文章目录 第6章 libmodbus使用6.1 libmodbus开发库6.1.1 功能概要6.1.2 源码获取6.1.3 源码阅读1. 新建工程2. 同步文件3.打开工程4. 操作示例5. 快捷键 6.1.4 libmodbus与应用程序的关系 6.2 libmodbus源代码解析6.2.1 核心函数6.2.2 框架分析与数据结构6.2.3 情景分析1. 初始…

ASUS华硕A豆14笔记本电脑I421EAYB,I421EQYB_ADOL14EA工厂模式原厂Win11系统安装包下载

适用型号&#xff1a;ADOL14EA笔记本I421EAYB、I421EQYB 链接&#xff1a;https://pan.baidu.com/s/1krU8m_lbApyUfZQo5E4cCQ?pwd0ewl 提取码&#xff1a;0ewl 华硕原装WIN11系统工厂安装包&#xff0c;带有MyASUS WinRE RECOVERY恢复功能、自带所有驱动、出厂主题壁纸、系…

磁共振图像MRI重建实现

最近涉及到了磁共振图像MRI的重建&#xff0c;网络上相关的实现比较少&#xff0c;因此进行实现记录。 磁共振图像MRI重建实现 1.配置代码环境2.MRI数据集处理3.配置数据集以及模型文件5.训练 1.配置代码环境 这里介绍一个很好的开源项目&#xff0c;git为&#xff1a; https…

【SpringMVC】_SpringMVC实现留言墙

目录 1. 需求分析 2. 接口定义 2.1 提交留言 2.2 获取全部留言 3. 响应数据 4. 服务器代码 4.1 MessageInfo 文件 4.2 MessageController 文件 5. 前端页面代码 5. 运行测试 1. 需求分析 实现如下页面&#xff1a; 1、输入留言信息&#xff0c;点击提交后&#xff0…

京东618风云再起,极空间私有云蝉联销冠,AI NAS技术绘就行业新篇章

2023年极空间私有云占据京东618全周期网络存储成交额的榜首&#xff0c;而在今年618极空间延续了往年佳绩再次斩获销冠之位&#xff0c;这已是其连续两年在京东618中夺得销售冠军。自进军NAS行业以来&#xff0c;极空间不仅深耕于智能存储技术&#xff0c;更积极投身AI研发&…

6.27-6.29 旧c语言

#include<stdio.h> struct stu {int num;float score;struct stu *next; }; void main() {struct stu a,b,c,*head;//静态链表a.num 1;a.score 10;b.num 2;b.score 20;c.num 3;c.score 30;head &a;a.next &b;b.next &c;do{printf("%d,%5.1f\n&…

JeecgBoot中如何对敏感信息进行脱敏处理?

数据脱敏即将一些敏感信息通过加密、格式化等方式处理&#xff0c;展示给用户一个新的或是格式化后的信息&#xff0c;避免了敏感信息的暴露。 一、接口脱敏注解 针对接口数据实现脱敏加密&#xff0c;只加密&#xff0c;一般此方案用于数据加密展示。 1.1 注解介绍 注解作用域…

C语言 | Leetcode C语言题解之第204题计数质数

题目&#xff1a; 题解&#xff1a; int countPrimes(int n) {if (n < 2) {return 0;}int isPrime[n];int primes[n], primesSize 0;memset(isPrime, 0, sizeof(isPrime));for (int i 2; i < n; i) {if (!isPrime[i]) {primes[primesSize] i;}for (int j 0; j < …

stm32学习笔记---ADC模数转换器(代码部分)AD单通道/多通道

目录 第一个代码&#xff1a;AD单通道 ADC初始化步骤 ADC相关的库函数 RCC_ADCCLKConfig 三个初始化相关函数 ADC_Cmd ADC_DMACmd ADC_ITConfig 四个校准相关函数 ADC_SoftwareStartConvCmd ADC_GetSoftwareStartConvStatus ADC_GetFlagStatus ADC_RegularChannel…

Flask之电子邮件

前言&#xff1a;本博客仅作记录学习使用&#xff0c;部分图片出自网络&#xff0c;如有侵犯您的权益&#xff0c;请联系删除 目录 一、使用Flask-Mail发送电子邮件 1.1、配置Flask-Mail 1.2、构建邮件数据 1.3、发送邮件 二、使用事务邮件服务SendGrid 2.1、注册SendGr…

【2024最新华为OD-C/D卷试题汇总】[支持在线评测] LYA的字符串拼接游戏(200分) - 三语言AC题解(Python/Java/Cpp)

&#x1f36d; 大家好这里是清隆学长 &#xff0c;一枚热爱算法的程序员 ✨ 本系列打算持续跟新华为OD-C/D卷的三语言AC题解 &#x1f4bb; ACM银牌&#x1f948;| 多次AK大厂笔试 &#xff5c; 编程一对一辅导 &#x1f44f; 感谢大家的订阅➕ 和 喜欢&#x1f497; &#x1f…

动手学深度学习(Pytorch版)代码实践 -卷积神经网络-21多输入多输出通道

21多输入多输出通道 import torch from d2l import torch as d2ldef corr2d(X, K):"""计算二维互相关运算"""h, w K.shapeY torch.zeros((X.shape[0] - h 1, X.shape[1] - w 1))for i in range(Y.shape[0]):for j in range(Y.shape[1]):Y[i,…

【操作系统期末速成】 EP02 | 学习笔记(基于五道口一只鸭)

文章目录 一、前言&#x1f680;&#x1f680;&#x1f680;二、正文&#xff1a;☀️☀️☀️2.1 考点二&#xff1a;操作系统的功能及接口2.2 考点三&#xff1a;操作系统的发展及分类2.3 考点四&#xff1a;操作系统的运行环境&#xff08;重要&#xff09; 一、前言&#x…

私域流量的深度解析与电商应用

一、私域流量的核心价值 在当今数字化时代&#xff0c;流量成为了企业发展的重要资源。与公域流量相比&#xff0c;私域流量以其独有的私有性和可复用性&#xff0c;为企业提供了与用户建立深度联系的机会。私域流量不仅有助于企业精准触达目标用户&#xff0c;还能通过数据分…

小白学webgl合集-WebGL中给图片添加背景

一.实现效果 二.逻辑 为了在WebGL中给图片添加背景&#xff0c;主要的逻辑步骤包括初始化WebGL上下文、编写和编译着色器、创建和绑定缓冲区、加载和配置纹理以及绘制场景。以下是代码逻辑的详细说明&#xff1a; 1. 获取WebGL上下文 首先&#xff0c;通过获取<canvas>…

Qt信号槽的坑

1、重载的信号&#xff08;以QSpinBox为例&#xff09; 像是点击按钮之类的信号槽很好连接&#xff0c;这是因为它的信号没有重载&#xff0c;如果像SpinBox那样有重载信号的话&#xff08;Qt5.12的见下图&#xff0c;不过Qt5.15LTS开始就不再重载而是换信号名了&#xff09;&…

【融合ChatGPT等AI模型】Python-GEE遥感云大数据分析、管理与可视化及多领域案例应用

随着航空、航天、近地空间遥感平台的持续发展&#xff0c;遥感技术近年来取得显著进步。遥感数据的空间、时间、光谱分辨率及数据量均大幅提升&#xff0c;呈现出大数据特征。这为相关研究带来了新机遇&#xff0c;但同时也带来巨大挑战。传统的工作站和服务器已无法满足大区域…

微服务实战系列之云原生

前言 话说博主的微服务实战系列从去年走到今天&#xff0c;已过去了半年多了。本系列&#xff0c;博主主要围绕微服务实践过程中的主要组件或工具展开介绍。其中基本覆盖了我们项目或产品研发过程中&#xff0c;经常使用的中间件或第三方工具。至此&#xff0c;该系列也该朝着…

web刷题记录(7)

[HDCTF 2023]SearchMaster 打开环境&#xff0c;首先的提示信息就是告诉我们&#xff0c;可以用post传参的方式来传入参数data 首先考虑的还是rce&#xff0c;但是这里发现&#xff0c;不管输入那种命令&#xff0c;它都会直接显示在中间的那一小行里面&#xff0c;而实际的命令…

ProPainter – AI视频去水印工具,可以去除视频中的静态水印、动态物体/人物等 本地一键整合包下载

ProPainter是一个基于E2FGVI实现的AI视频编辑工具&#xff0c;它可以一键移除视频内的移动物体和水印。这个开源项目提供了一个简单而强大的解决方案&#xff0c;帮助用户轻松编辑和改善视频内容。 项目地址&#xff1a;https://github.com/sczhou/ProPainter 一键包下载&…