ROS+雷达 运行数据记录

先测试一下雷达,记录数据。方便接下来分析源码。

1.roslaunch robot_navigation lidar.launch

@robot:~$ roslaunch robot_navigation lidar.launch
... logging to /home/jym/.ros/log/7136849a-92cc-11ec-acff-ac8247315e93/roslaunch-robot-9556.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.110:41393/SUMMARY
========PARAMETERS* /rosdistro: melodic* /rosversion: 1.14.10* /rplidarNode/angle_compensate: True* /rplidarNode/frame_id: base_laser_link* /rplidarNode/inverted: False* /rplidarNode/serial_baudrate: 115200* /rplidarNode/serial_port: /dev/rplidar* /rplidarNode/smart_control: TrueNODES/base_footprint_to_laser (tf/static_transform_publisher)rplidarNode (rplidar_ros/rplidarNode)auto-starting new master
process[master]: started with pid [9566]
ROS_MASTER_URI=http://192.168.0.110:11311setting /run_id to 7136849a-92cc-11ec-acff-ac8247315e93
process[rosout-1]: started with pid [9588]
started core service [/rosout]
process[rplidarNode-2]: started with pid [9591]
process[base_footprint_to_laser-3]: started with pid [9593]
[ INFO] [1645416734.958421258]: RPLIDAR running on ROS package rplidar_ros. SDK Version:1.12.0
RPLIDAR S/N: B2BA9A86C0E09CC7A2E09DF720683077
[ INFO] [1645416737.467053046]: Firmware Ver: 1.29
[ INFO] [1645416737.467136487]: Hardware Rev: 7
[ INFO] [1645416737.468602280]: RPLidar health status : 0
[ INFO] [1645416737.513749572]: current scan mode: Sensitivity, max_distance: 12.0 m, Point number: 7.9K , angle_compensate: 2
@robot:~$ rostopic list
/rosout
/rosout_agg
/scan
/tf@ubuntu:~$ rostopic info /tf
Type: tf2_msgs/TFMessagePublishers: * /base_footprint_to_laser (http://192.168.0.110:34067/)Subscribers: None@ubuntu:~$ rostopic info /scan
Type: sensor_msgs/LaserScanPublishers: * /rplidarNode (http://192.168.0.110:43615/)Subscribers: None@ubuntu:~$ rostopic echo /tf
transforms: - header: seq: 0stamp: secs: 1645416938nsecs: 168626559frame_id: "/base_footprint"child_frame_id: "base_laser_link"transform: translation: x: 0.1037y: 0.0z: 0.165rotation: x: 0.0y: 0.0z: 1.0w: 1.79489651492e-09
---
transforms: - header: seq: 0stamp: secs: 1645416938nsecs: 188753740frame_id: "/base_footprint"child_frame_id: "base_laser_link"transform: translation: x: 0.1037y: 0.0z: 0.165rotation: x: 0.0y: 0.0z: 1.0w: 1.79489651492e-09
---
@ubuntu:~$ rostopic echo /scan
header: seq: 3341stamp: secs: 1645416999nsecs: 820906601frame_id: "base_laser_link"
angle_min: -3.12413907051
angle_max: 3.14159274101
angle_increment: 0.00871450919658
time_increment: 0.000101421544969
scan_time: 0.0729220882058
range_min: 0.15000000596
range_max: 12.0
ranges: [0.7699999809265137, 省略,0.7720000147819519]
intensities: [47.0, 省略,47.0]
---
header: seq: 3342stamp: secs: 1645416999nsecs: 894679719frame_id: "base_laser_link"
angle_min: -3.12413907051
angle_max: 3.14159274101
angle_increment: 0.00871450919658
time_increment: 0.000118369433039
scan_time: 0.0851076245308
range_min: 0.15000000596
range_max: 12.0
ranges: [0.7699999809265137,...省略,inf]
intensities: [47.0, 47.0,....省略, 0.0]
---

一部分ranges:
在这里插入图片描述
一部分intensities:
在这里插入图片描述

2.roslaunch robot_navigation lidar_rviz.launch

@ubuntu:~$ roslaunch robot_navigation lidar_rviz.launch
... logging to /home/jym/.ros/log/7136849a-92cc-11ec-acff-ac8247315e93/roslaunch-ubuntu-3100.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.117:41259/SUMMARY
========PARAMETERS* /rosdistro: melodic* /rosversion: 1.14.10NODES/rviz (rviz/rviz)ROS_MASTER_URI=http://192.168.0.110:11311process[rviz-1]: started with pid [3113]

在这里插入图片描述

3.roslaunch robot_navigation robot_slam_laser.launch

@robot:~$ roslaunch robot_navigation robot_slam_laser.launch
... logging to /home/jym/.ros/log/a8ed1e48-92cd-11ec-8c26-ac8247315e93/roslaunch-robot-12482.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.110:38585/SUMMARY
========PARAMETERS* /base_control/ackermann_cmd_topic: ackermann_cmd* /base_control/base_id: base_footprint* /base_control/battery_topic: battery* /base_control/baudrate: 115200* /base_control/cmd_vel_topic: cmd_vel* /base_control/imu_id: imu* /base_control/imu_topic: imu* /base_control/odom_id: odom* /base_control/odom_topic: odom* /base_control/port: /dev/move_base* /base_control/pub_imu: False* /base_control/pub_sonar: False* /base_control/sub_ackermann: False* /gmapping/angularUpdate: 0.2* /gmapping/astep: 0.05* /gmapping/base_frame: base_footprint* /gmapping/delta: 0.05* /gmapping/iterations: 5* /gmapping/kernelSize: 1* /gmapping/lasamplerange: 0.005* /gmapping/lasamplestep: 0.005* /gmapping/linearUpdate: 1.0* /gmapping/llsamplerange: 0.01* /gmapping/llsamplestep: 0.01* /gmapping/lsigma: 0.075* /gmapping/lskip: 0* /gmapping/lstep: 0.05* /gmapping/map_frame: map* /gmapping/map_update_interval: 2.0* /gmapping/maxUrange: 5.0* /gmapping/minimumScore: 50* /gmapping/odom_frame: odom* /gmapping/ogain: 3.0* /gmapping/particles: 100* /gmapping/resampleThreshold: 0.5* /gmapping/sigma: 0.05* /gmapping/srr: 0.1* /gmapping/srt: 0.2* /gmapping/str: 0.1* /gmapping/stt: 0.2* /gmapping/temporalUpdate: 0.5* /gmapping/xmax: 10.0* /gmapping/xmin: -10.0* /gmapping/ymax: 10.0* /gmapping/ymin: -10.0* /rosdistro: melodic* /rosversion: 1.14.10* /rplidarNode/angle_compensate: True* /rplidarNode/frame_id: base_laser_link* /rplidarNode/inverted: False* /rplidarNode/serial_baudrate: 115200* /rplidarNode/serial_port: /dev/rplidar* /rplidarNode/smart_control: True* /use_sim_time: FalseNODES/base_control (base_control/base_control.py)base_footprint_to_laser (tf/static_transform_publisher)gmapping (gmapping/slam_gmapping)rplidarNode (rplidar_ros/rplidarNode)auto-starting new master
process[master]: started with pid [12492]
ROS_MASTER_URI=http://192.168.0.110:11311setting /run_id to a8ed1e48-92cd-11ec-8c26-ac8247315e93
process[rosout-1]: started with pid [12504]
started core service [/rosout]
process[base_control-2]: started with pid [12512]
process[rplidarNode-3]: started with pid [12513]
process[base_footprint_to_laser-4]: started with pid [12514]
[ INFO] [1645417257.540586416]: RPLIDAR running on ROS package rplidar_ros. SDK Version:1.12.0
process[gmapping-5]: started with pid [12520]
RPLIDAR S/N: B2BA9A86C0E09CC7A2E09DF720683077
[ INFO] [1645417260.051225194]: Firmware Ver: 1.29
[ INFO] [1645417260.051379306]: Hardware Rev: 7
[ INFO] [1645417260.052906823]: RPLidar health status : 0
[ INFO] [1645417260.102903048]: current scan mode: Sensitivity, max_distance: 12.0 m, Point number: 7.9K , angle_compensate: 2
[INFO] [1645417260.503548]: NanoCar_Pro base control ...
[INFO] [1645417260.528157]: Opening Serial
[INFO] [1645417260.531035]: Serial Open Succeed
[INFO] [1645417261.110526]: Move Base Hardware Ver 2.1.0,Firmware Ver 2.1.3
[INFO] [1645417261.184878]: SN:002b00413138511532323338
[INFO] [1645417261.195020]: Type:RC_ACKERMAN Motor:RS365 Ratio:11.0 WheelDiameter:72.0
[ INFO] [1645417261.393525561]: Laser is mounted upwards.-maxUrange 5 -maxUrange 11.99 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05-srr 0.1 -srt 0.2 -str 0.1 -stt 0.2-linearUpdate 1 -angularUpdate 0.2 -resampleThreshold 0.5-xmin -10 -xmax 10 -ymin -10 -ymax 10 -delta 0.05 -particles 100
[ INFO] [1645417261.399562302]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 0
Registering First Scan
update frame 7
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 1
Average Scan Matching Score=441.909
neff= 100
Registering Scans:Done
update frame 8
update ld=1.38778e-17 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 2
Average Scan Matching Score=458.721
neff= 100
Registering Scans:Done
update frame 9
update ld=1.38778e-17 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 3
Average Scan Matching Score=451.226
neff= 100
Registering Scans:Done
update frame 10
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 4
Average Scan Matching Score=463.392
neff= 100
Registering Scans:Done
update frame 11
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 5
^C[gmapping-5] killing on exit
[base_footprint_to_laser-4] killing on exit
[rplidarNode-3] killing on exit
[base_control-2] killing on exit
Average Scan Matching Score=443.591
neff= 100
Registering Scans:Done
update frame 12
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 6
Average Scan Matching Score=448.561
neff= 100
Registering Scans:Done
virtual GMapping::GridSlamProcessor::~GridSlamProcessor(): Start
virtual GMapping::GridSlamProcessor::~GridSlamProcessor(): Deleting tree
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
@robot:~$ rostopic list
/battery
/cmd_vel
/gmapping/entropy
/map
/map_metadata
/odom
/rosout
/rosout_agg
/scan
/tf
/tf_static

4.roslaunch robot_navigation slam_rviz.launch

@ubuntu:~$ roslaunch robot_navigation slam_rviz.launch
... logging to /home/jym/.ros/log/fd795bf2-92cd-11ec-a7fa-ac8247315e93/roslaunch-ubuntu-3189.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.117:37773/SUMMARY
========PARAMETERS* /rosdistro: melodic* /rosversion: 1.14.10NODES/rviz (rviz/rviz)ROS_MASTER_URI=http://192.168.0.110:11311process[rviz-1]: started with pid [3198]

在这里插入图片描述

@ubuntu:~$ rostopic list
/battery
/clicked_point
/cmd_vel
/exploration_polygon_marker
/exploration_polygon_marker_array
/gmapping/entropy
/initialpose
/map
/map_metadata
/map_updates
/move_base/NavfnROS/plan
/move_base_simple/goal
/odom
/rosout
/rosout_agg
/scan
/tf
/tf_static
@ubuntu:~$ rosrun rqt_tf_tree rqt_tf_tree

在这里插入图片描述

@ubuntu:~$ rosrun rqt_graph rqt_graph

在这里插入图片描述

黑色边框部分是实际地形中的墙壁,地图四周边界已经全部闭合或者想要保存地图时候。
robot:
roscd robot_navigation/maps
rosrun map_server map_saver -f map
@robot:~$ roscd robot_navigation/maps
@robot:~/catkin_ws/src/robot_navigation/maps$ ls
cartographer.pgm   gmapping.pgm   hector.pgm   karto.pgm   map.pgm
cartographer.yaml  gmapping.yaml  hector.yaml  karto.yaml  map.yaml
@robot:~/catkin_ws/src/robot_navigation/maps$ vim map.yaml打开看到:
image: map.pgm
resolution: 0.050000
origin: [-10.000000, -10.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
@robot:~/catkin_ws/src/robot_navigation/maps$ rosrun map_server map_saver -f map
[ INFO] [1645418348.405455319]: Waiting for the map
[ INFO] [1645418348.606461007]: Received a 384 X 384 map @ 0.050 m/pix
[ INFO] [1645418348.606572677]: Writing map occupancy data to map.pgm
[ INFO] [1645418348.620467557]: Writing map occupancy data to map.yaml
[ INFO] [1645418348.620892465]: Done

在这里插入图片描述

5.roslaunch robot_navigation robot_navigation.launch

@robot:~$ roslaunch robot_navigation robot_navigation.launch
... logging to /home/jym/.ros/log/d7006d78-92d0-11ec-a74f-ac8247315e93/roslaunch-robot-19558.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.110:34203/SUMMARY
========PARAMETERS* /amcl/aser_z_short: 0.05* /amcl/base_frame_id: base_footprint* /amcl/global_frame_id: map* /amcl/gui_publish_rate: 10.0* /amcl/initial_pose_a: 0.0* /amcl/initial_pose_x: 0.0* /amcl/initial_pose_y: 0.0* /amcl/kld_err: 0.05* /amcl/kld_z: 0.99* /amcl/laser_lambda_short: 0.1* /amcl/laser_likelihood_max_dist: 2.0* /amcl/laser_max_beams: 60* /amcl/laser_max_range: 12.0* /amcl/laser_model_type: likelihood_field* /amcl/laser_sigma_hit: 0.2* /amcl/laser_z_hit: 0.5* /amcl/laser_z_max: 0.05* /amcl/laser_z_rand: 0.5* /amcl/max_particles: 2000* /amcl/min_particles: 500* /amcl/odom_alpha1: 0.2* /amcl/odom_alpha2: 0.2* /amcl/odom_alpha3: 0.2* /amcl/odom_alpha4: 0.2* /amcl/odom_alpha5: 0.1* /amcl/odom_frame_id: odom* /amcl/odom_model_type: diff* /amcl/recovery_alpha_fast: 0.1* /amcl/recovery_alpha_slow: 0.001* /amcl/resample_interval: 1* /amcl/transform_tolerance: 1.0* /amcl/update_min_a: 0.2* /amcl/update_min_d: 0.25* /amcl/use_map_topic: True* /base_control/ackermann_cmd_topic: ackermann_cmd* /base_control/base_id: base_footprint* /base_control/battery_topic: battery* /base_control/baudrate: 115200* /base_control/cmd_vel_topic: cmd_vel* /base_control/imu_id: imu* /base_control/imu_topic: imu* /base_control/odom_id: odom* /base_control/odom_topic: odom* /base_control/port: /dev/move_base* /base_control/pub_imu: False* /base_control/pub_sonar: False* /base_control/sub_ackermann: False* /map_server/frame_id: map* /move_base/GlobalPlanner/use_dijkstra: True* /move_base/TebLocalPlannerROS/acc_lim_theta: 0.5* /move_base/TebLocalPlannerROS/acc_lim_x: 0.5* /move_base/TebLocalPlannerROS/allow_init_with_backwards_motion: True* /move_base/TebLocalPlannerROS/cmd_angle_instead_rotvel: False* /move_base/TebLocalPlannerROS/complete_global_plan: True* /move_base/TebLocalPlannerROS/costmap_converter_plugin: * /move_base/TebLocalPlannerROS/costmap_converter_rate: 5* /move_base/TebLocalPlannerROS/costmap_converter_spin_thread: True* /move_base/TebLocalPlannerROS/costmap_obstacles_behind_robot_dist: 1.5* /move_base/TebLocalPlannerROS/delete_detours_backwards: True* /move_base/TebLocalPlannerROS/dt_hysteresis: 0.1* /move_base/TebLocalPlannerROS/dt_ref: 0.3* /move_base/TebLocalPlannerROS/dynamic_obstacle_inflation_dist: 0.6* /move_base/TebLocalPlannerROS/enable_homotopy_class_planning: False* /move_base/TebLocalPlannerROS/enable_multithreading: True* /move_base/TebLocalPlannerROS/exact_arc_length: False* /move_base/TebLocalPlannerROS/feasibility_check_no_poses: 2* /move_base/TebLocalPlannerROS/footprint_model/line_end: [0.1, 0.0]* /move_base/TebLocalPlannerROS/footprint_model/line_start: [0.05, 0.0]* /move_base/TebLocalPlannerROS/footprint_model/type: line* /move_base/TebLocalPlannerROS/free_goal_vel: False* /move_base/TebLocalPlannerROS/global_plan_overwrite_orientation: True* /move_base/TebLocalPlannerROS/global_plan_prune_distance: 1* /move_base/TebLocalPlannerROS/global_plan_viapoint_sep: -1* /move_base/TebLocalPlannerROS/h_signature_prescaler: 0.5* /move_base/TebLocalPlannerROS/h_signature_threshold: 0.1* /move_base/TebLocalPlannerROS/include_costmap_obstacles: True* /move_base/TebLocalPlannerROS/include_dynamic_obstacles: True* /move_base/TebLocalPlannerROS/inflation_dist: 0.6* /move_base/TebLocalPlannerROS/max_global_plan_lookahead_dist: 3.0* /move_base/TebLocalPlannerROS/max_number_classes: 4* /move_base/TebLocalPlannerROS/max_ratio_detours_duration_best_duration: 3.0* /move_base/TebLocalPlannerROS/max_samples: 500* /move_base/TebLocalPlannerROS/max_vel_theta: 0.53* /move_base/TebLocalPlannerROS/max_vel_x: 0.2* /move_base/TebLocalPlannerROS/max_vel_x_backwards: 0.2* /move_base/TebLocalPlannerROS/max_vel_y: 0.0* /move_base/TebLocalPlannerROS/min_obstacle_dist: 0.12* /move_base/TebLocalPlannerROS/min_turning_radius: 0.375* /move_base/TebLocalPlannerROS/no_inner_iterations: 5* /move_base/TebLocalPlannerROS/no_outer_iterations: 4* /move_base/TebLocalPlannerROS/obstacle_cost_exponent: 4* /move_base/TebLocalPlannerROS/obstacle_heading_threshold: 0.45* /move_base/TebLocalPlannerROS/obstacle_poses_affected: 15* /move_base/TebLocalPlannerROS/odom_topic: odom* /move_base/TebLocalPlannerROS/optimization_activate: True* /move_base/TebLocalPlannerROS/optimization_verbose: False* /move_base/TebLocalPlannerROS/oscillation_filter_duration: 10* /move_base/TebLocalPlannerROS/oscillation_omega_eps: 0.1* /move_base/TebLocalPlannerROS/oscillation_recovery: False* /move_base/TebLocalPlannerROS/oscillation_recovery_min_duration: 10* /move_base/TebLocalPlannerROS/oscillation_v_eps: 0.1* /move_base/TebLocalPlannerROS/penalty_epsilon: 0.1* /move_base/TebLocalPlannerROS/publish_feedback: False* /move_base/TebLocalPlannerROS/roadmap_graph_area_length_scale: 1.0* /move_base/TebLocalPlannerROS/roadmap_graph_area_width: 5* /move_base/TebLocalPlannerROS/roadmap_graph_no_samples: 15* /move_base/TebLocalPlannerROS/selection_alternative_time_cost: False* /move_base/TebLocalPlannerROS/selection_cost_hysteresis: 1.0* /move_base/TebLocalPlannerROS/selection_obst_cost_scale: 1.0* /move_base/TebLocalPlannerROS/selection_prefer_initial_plan: 0.95* /move_base/TebLocalPlannerROS/shrink_horizon_backup: True* /move_base/TebLocalPlannerROS/shrink_horizon_min_duration: 10* /move_base/TebLocalPlannerROS/switching_blocking_period: 0.0* /move_base/TebLocalPlannerROS/teb_autosize: True* /move_base/TebLocalPlannerROS/viapoints_all_candidates: True* /move_base/TebLocalPlannerROS/visualize_hc_graph: False* /move_base/TebLocalPlannerROS/visualize_with_time_as_z_axis_scale: False* /move_base/TebLocalPlannerROS/weight_acc_lim_theta: 1* /move_base/TebLocalPlannerROS/weight_acc_lim_x: 1* /move_base/TebLocalPlannerROS/weight_adapt_factor: 2* /move_base/TebLocalPlannerROS/weight_dynamic_obstacle: 10* /move_base/TebLocalPlannerROS/weight_dynamic_obstacle_inflation: 0.2* /move_base/TebLocalPlannerROS/weight_inflation: 0.2* /move_base/TebLocalPlannerROS/weight_kinematics_forward_drive: 1* /move_base/TebLocalPlannerROS/weight_kinematics_nh: 1000* /move_base/TebLocalPlannerROS/weight_kinematics_turning_radius: 1* /move_base/TebLocalPlannerROS/weight_max_vel_theta: 1* /move_base/TebLocalPlannerROS/weight_max_vel_x: 2* /move_base/TebLocalPlannerROS/weight_obstacle: 100* /move_base/TebLocalPlannerROS/weight_optimaltime: 1* /move_base/TebLocalPlannerROS/weight_shortest_path: 0* /move_base/TebLocalPlannerROS/weight_viapoint: 1* /move_base/TebLocalPlannerROS/wheelbase: 0.145* /move_base/TebLocalPlannerROS/xy_goal_tolerance: 0.1* /move_base/TebLocalPlannerROS/yaw_goal_tolerance: 0.2* /move_base/base_global_planner: global_planner/Gl...* /move_base/base_local_planner: teb_local_planner...* /move_base/clearing_rotation_allowed: False* /move_base/conservative_reset_dist: 0.2* /move_base/controller_frequency: 2.0* /move_base/controller_patience: 15.0* /move_base/global_costmap/footprint: [[-0.035, -0.1], ...* /move_base/global_costmap/global_frame: map* /move_base/global_costmap/inflation_layer/cost_scaling_factor: 10.0* /move_base/global_costmap/inflation_layer/enabled: True* /move_base/global_costmap/inflation_layer/inflation_radius: 0.1* /move_base/global_costmap/obstacle_layer/combination_method: 1* /move_base/global_costmap/obstacle_layer/enabled: True* /move_base/global_costmap/obstacle_layer/inflation_radius: 0.05* /move_base/global_costmap/obstacle_layer/laser_scan_sensor/clearing: True* /move_base/global_costmap/obstacle_layer/laser_scan_sensor/data_type: LaserScan* /move_base/global_costmap/obstacle_layer/laser_scan_sensor/marking: True* /move_base/global_costmap/obstacle_layer/laser_scan_sensor/topic: scan* /move_base/global_costmap/obstacle_layer/observation_sources: laser_scan_sensor* /move_base/global_costmap/obstacle_layer/obstacle_range: 2.5* /move_base/global_costmap/obstacle_layer/raytrace_range: 3.0* /move_base/global_costmap/obstacle_layer/track_unknown_space: False* /move_base/global_costmap/plugins: [{'type': 'costma...* /move_base/global_costmap/publish_frequency: 0.5* /move_base/global_costmap/robot_base_frame: base_footprint* /move_base/global_costmap/static_layer/enabled: True* /move_base/global_costmap/static_layer/map_topic: /map* /move_base/global_costmap/transform_tolerance: 0.5* /move_base/global_costmap/update_frequency: 1.0* /move_base/local_costmap/footprint: [[-0.035, -0.1], ...* /move_base/local_costmap/global_frame: map* /move_base/local_costmap/height: 3* /move_base/local_costmap/inflation_layer/cost_scaling_factor: 10.0* /move_base/local_costmap/inflation_layer/enabled: True* /move_base/local_costmap/inflation_layer/inflation_radius: 0.1* /move_base/local_costmap/obstacle_layer/combination_method: 1* /move_base/local_costmap/obstacle_layer/enabled: True* /move_base/local_costmap/obstacle_layer/inflation_radius: 0.05* /move_base/local_costmap/obstacle_layer/laser_scan_sensor/clearing: True* /move_base/local_costmap/obstacle_layer/laser_scan_sensor/data_type: LaserScan* /move_base/local_costmap/obstacle_layer/laser_scan_sensor/marking: True* /move_base/local_costmap/obstacle_layer/laser_scan_sensor/topic: scan* /move_base/local_costmap/obstacle_layer/observation_sources: laser_scan_sensor* /move_base/local_costmap/obstacle_layer/obstacle_range: 2.5* /move_base/local_costmap/obstacle_layer/raytrace_range: 3.0* /move_base/local_costmap/obstacle_layer/track_unknown_space: False* /move_base/local_costmap/plugins: [{'type': 'costma...* /move_base/local_costmap/publish_frequency: 5.0* /move_base/local_costmap/resolution: 0.05* /move_base/local_costmap/robot_base_frame: base_footprint* /move_base/local_costmap/rolling_window: True* /move_base/local_costmap/static_layer/enabled: True* /move_base/local_costmap/static_layer/map_topic: /map* /move_base/local_costmap/transform_tolerance: 0.5* /move_base/local_costmap/update_frequency: 5.0* /move_base/local_costmap/width: 3* /move_base/oscillation_distance: 0.2* /move_base/oscillation_timeout: 10.0* /move_base/planner_frequency: 0.2* /move_base/planner_patience: 5.0* /rosdistro: melodic* /rosversion: 1.14.10* /rplidarNode/angle_compensate: True* /rplidarNode/frame_id: base_laser_link* /rplidarNode/inverted: False* /rplidarNode/serial_baudrate: 115200* /rplidarNode/serial_port: /dev/rplidar* /rplidarNode/smart_control: TrueNODES/amcl (amcl/amcl)base_control (base_control/base_control.py)base_footprint_to_laser (tf/static_transform_publisher)map_server (map_server/map_server)move_base (move_base/move_base)rplidarNode (rplidar_ros/rplidarNode)auto-starting new master
process[master]: started with pid [19568]
ROS_MASTER_URI=http://192.168.0.110:11311setting /run_id to d7006d78-92d0-11ec-a74f-ac8247315e93
process[rosout-1]: started with pid [19580]
started core service [/rosout]
process[base_control-2]: started with pid [19588]
process[rplidarNode-3]: started with pid [19589]
process[base_footprint_to_laser-4]: started with pid [19590]
[ INFO] [1645418623.654897278]: RPLIDAR running on ROS package rplidar_ros. SDK Version:1.12.0
process[map_server-5]: started with pid [19597]
process[amcl-6]: started with pid [19603]
process[move_base-7]: started with pid [19604]
[ INFO] [1645418624.119418253]: Subscribed to map topic.
[ INFO] [1645418624.297830472]: Received a 384 X 384 map @ 0.050 m/pix[ INFO] [1645418624.318718895]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1645418624.332496936]: Done initializing likelihood field model.
[INFO] [1645418626.164512]: NanoCar_Pro base control ...
RPLIDAR S/N: B2BA9A86C0E09CC7A2E09DF720683077
[ INFO] [1645418626.166586242]: Firmware Ver: 1.29
[ INFO] [1645418626.166672338]: Hardware Rev: 7
[ INFO] [1645418626.168322547]: RPLidar health status : 0
[INFO] [1645418626.191463]: Opening Serial
[INFO] [1645418626.194629]: Serial Open Succeed
[ INFO] [1645418626.214124208]: current scan mode: Sensitivity, max_distance: 12.0 m, Point number: 7.9K , angle_compensate: 2
[INFO] [1645418626.643383]: Move Base Hardware Ver 2.1.0,Firmware Ver 2.1.3
[INFO] [1645418626.709617]: SN:002b00413138511532323338
[INFO] [1645418626.714842]: Type:RC_ACKERMAN Motor:RS365 Ratio:11.0 WheelDiameter:72.0
[ INFO] [1645418628.458355880]: global_costmap: Using plugin "static_layer"
[ INFO] [1645418628.501041558]: Requesting the map...
[ INFO] [1645418628.706626676]: Resizing costmap to 384 X 384 at 0.050000 m/pix
[ INFO] [1645418628.806309371]: Received a 384 X 384 map at 0.050000 m/pix
[ INFO] [1645418628.815022252]: global_costmap: Using plugin "obstacle_layer"
[ INFO] [1645418628.832882923]:     Subscribed to Topics: laser_scan_sensor
[ INFO] [1645418628.910960088]: global_costmap: Using plugin "inflation_layer"
[ INFO] [1645418629.075856311]: local_costmap: Using plugin "static_layer"
[ INFO] [1645418629.090986271]: Requesting the map...
[ INFO] [1645418629.099615764]: Resizing static layer to 384 X 384 at 0.050000 m/pix
[ INFO] [1645418629.198297959]: Received a 384 X 384 map at 0.050000 m/pix
[ INFO] [1645418629.208358226]: local_costmap: Using plugin "obstacle_layer"
[ INFO] [1645418629.219131901]:     Subscribed to Topics: laser_scan_sensor
[ INFO] [1645418629.379627152]: Created local_planner teb_local_planner/TebLocalPlannerROS
[ INFO] [1645418629.552605769]: Footprint model 'line' (line_start: [0.05,0]m, line_end: [0.1,0]m) loaded for trajectory optimization.
[ INFO] [1645418629.553394023]: Parallel planning in distinctive topologies disabled.
[ INFO] [1645418629.553515537]: No costmap conversion plugin specified. All occupied costmap cells are treaten as point obstacles.
[ INFO] [1645418630.137914350]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1645418630.150906637]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1645418630.234827271]: odom received!
jym@ubuntu:~$ rostopic list
/amcl/parameter_descriptions
/amcl/parameter_updates
/amcl_pose
/battery
/cmd_vel
/diagnostics
/initialpose
/map
/map_metadata
/move_base/GlobalPlanner/parameter_descriptions
/move_base/GlobalPlanner/parameter_updates
/move_base/GlobalPlanner/plan
/move_base/GlobalPlanner/potential
/move_base/TebLocalPlannerROS/global_plan
/move_base/TebLocalPlannerROS/local_plan
/move_base/TebLocalPlannerROS/obstacles
/move_base/TebLocalPlannerROS/parameter_descriptions
/move_base/TebLocalPlannerROS/parameter_updates
/move_base/TebLocalPlannerROS/teb_feedback
/move_base/TebLocalPlannerROS/teb_markers
/move_base/TebLocalPlannerROS/teb_poses
/move_base/TebLocalPlannerROS/via_points
/move_base/cancel
/move_base/current_goal
/move_base/feedback
/move_base/global_costmap/costmap
/move_base/global_costmap/costmap_updates
/move_base/global_costmap/footprint
/move_base/global_costmap/inflation_layer/parameter_descriptions
/move_base/global_costmap/inflation_layer/parameter_updates
/move_base/global_costmap/obstacle_layer/clearing_endpoints
/move_base/global_costmap/obstacle_layer/parameter_descriptions
/move_base/global_costmap/obstacle_layer/parameter_updates
/move_base/global_costmap/parameter_descriptions
/move_base/global_costmap/parameter_updates
/move_base/global_costmap/static_layer/parameter_descriptions
/move_base/global_costmap/static_layer/parameter_updates
/move_base/goal
/move_base/local_costmap/costmap
/move_base/local_costmap/costmap_updates
/move_base/local_costmap/footprint
/move_base/local_costmap/obstacle_layer/parameter_descriptions
/move_base/local_costmap/obstacle_layer/parameter_updates
/move_base/local_costmap/parameter_descriptions
/move_base/local_costmap/parameter_updates
/move_base/local_costmap/static_layer/parameter_descriptions
/move_base/local_costmap/static_layer/parameter_updates
/move_base/parameter_descriptions
/move_base/parameter_updates
/move_base/result
/move_base/status
/move_base_simple/goal
/odom
/particlecloud
/rosout
/rosout_agg
/scan
/tf
/tf_static

roslaunch robot_navigation navigation_rviz.launch

@ubuntu:~$ roslaunch robot_navigation navigation_rviz.launch
... logging to /home/jym/.ros/log/d7006d78-92d0-11ec-a74f-ac8247315e93/roslaunch-ubuntu-3577.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.117:43839/SUMMARY
========PARAMETERS* /rosdistro: melodic* /rosversion: 1.14.10NODES/rviz (rviz/rviz)ROS_MASTER_URI=http://192.168.0.110:11311process[rviz-1]: started with pid [3586]

在这里插入图片描述

![Snipaste_2022-02-21_12-49-32](Snipaste_2022-02-21_12-49-32.png)@ubuntu:~$ rostopic list
/amcl/parameter_descriptions
/amcl/parameter_updates
/amcl_pose
/battery
/clicked_point
/cmd_vel
/diagnostics
/initialpose
/map
/map_metadata
/map_updates
/move_base/DWAPlannerROS/cost_cloud
/move_base/DWAPlannerROS/global_plan
/move_base/DWAPlannerROS/local_plan
/move_base/DWAPlannerROS/trajectory_cloud
/move_base/GlobalPlanner/parameter_descriptions
/move_base/GlobalPlanner/parameter_updates
/move_base/GlobalPlanner/plan
/move_base/GlobalPlanner/potential
/move_base/GlobalPlanner/potential_updates
/move_base/TebLocalPlannerROS/global_plan
/move_base/TebLocalPlannerROS/local_plan
/move_base/TebLocalPlannerROS/obstacles
/move_base/TebLocalPlannerROS/parameter_descriptions
/move_base/TebLocalPlannerROS/parameter_updates
/move_base/TebLocalPlannerROS/teb_feedback
/move_base/TebLocalPlannerROS/teb_markers
/move_base/TebLocalPlannerROS/teb_poses
/move_base/TebLocalPlannerROS/via_points
/move_base/cancel
/move_base/current_goal
/move_base/feedback
/move_base/global_costmap/costmap
/move_base/global_costmap/costmap_updates
/move_base/global_costmap/footprint
/move_base/global_costmap/inflation_layer/parameter_descriptions
/move_base/global_costmap/inflation_layer/parameter_updates
/move_base/global_costmap/obstacle_layer/clearing_endpoints
/move_base/global_costmap/obstacle_layer/parameter_descriptions
/move_base/global_costmap/obstacle_layer/parameter_updates
/move_base/global_costmap/parameter_descriptions
/move_base/global_costmap/parameter_updates
/move_base/global_costmap/static_layer/parameter_descriptions
/move_base/global_costmap/static_layer/parameter_updates
/move_base/goal
/move_base/local_costmap/costmap
/move_base/local_costmap/costmap_updates
/move_base/local_costmap/footprint
/move_base/local_costmap/obstacle_layer/parameter_descriptions
/move_base/local_costmap/obstacle_layer/parameter_updates
/move_base/local_costmap/parameter_descriptions
/move_base/local_costmap/parameter_updates
/move_base/local_costmap/static_layer/parameter_descriptions
/move_base/local_costmap/static_layer/parameter_updates
/move_base/parameter_descriptions
/move_base/parameter_updates
/move_base/result
/move_base/status
/move_base_simple/goal
/odom
/particlecloud
/path_point
/rosout
/rosout_agg
/scan
/tf
/tf_static
@ubuntu:~$ rosrun rqt_graph rqt_graph

在这里插入图片描述

在这里插入图片描述

pc:rviz:2D Nav Goal设置导航目标。按下鼠标左键指定目标点方向,松开鼠标,执行导航任务。
robot:
[ WARN] [1645419212.414525914]: Clearing both costmaps to unstuck robot (0.20m).
[ INFO] [1645419227.414547893]: GOAL Reached!
到达指定目标点,过程中具有路径规划和避障功能。

在这里插入图片描述

@ubuntu:~$ rosnode list
/amcl
/base_control
/base_footprint_to_laser
/map_server
/move_base
/rosout
/rplidarNode
/rviz
@ubuntu:~$ rostopic echo /amcl_pose
header: seq: 9stamp: secs: 1645419587nsecs: 722414364frame_id: "map"
pose: pose: position: x: 0.122417531975y: -0.138680257969z: 0.0orientation: x: 0.0y: 0.0z: 0.214837962559w: 0.976649706826covariance: [0.029971075946912572, 0.008297713726329774, 0.0, 0.0, 0.0, 0.0, 0.008297713726329772, 0.027946463969230503, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.06360104777578718]
---

roslaunch robot_navigation robot_slam_laser.launch

@robot:~$ roslaunch robot_navigation robot_slam_laser.launch
... logging to /home/jym/.ros/log/0d9eb03a-92d4-11ec-93b6-ac8247315e93/roslaunch-robot-26850.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://192.168.0.110:34605/SUMMARY
========PARAMETERS* /base_control/ackermann_cmd_topic: ackermann_cmd* /base_control/base_id: base_footprint* /base_control/battery_topic: battery* /base_control/baudrate: 115200* /base_control/cmd_vel_topic: cmd_vel* /base_control/imu_id: imu* /base_control/imu_topic: imu* /base_control/odom_id: odom* /base_control/odom_topic: odom* /base_control/port: /dev/move_base* /base_control/pub_imu: False* /base_control/pub_sonar: False* /base_control/sub_ackermann: False* /gmapping/angularUpdate: 0.2* /gmapping/astep: 0.05* /gmapping/base_frame: base_footprint* /gmapping/delta: 0.05* /gmapping/iterations: 5* /gmapping/kernelSize: 1* /gmapping/lasamplerange: 0.005* /gmapping/lasamplestep: 0.005* /gmapping/linearUpdate: 1.0* /gmapping/llsamplerange: 0.01* /gmapping/llsamplestep: 0.01* /gmapping/lsigma: 0.075* /gmapping/lskip: 0* /gmapping/lstep: 0.05* /gmapping/map_frame: map* /gmapping/map_update_interval: 2.0* /gmapping/maxUrange: 5.0* /gmapping/minimumScore: 50* /gmapping/odom_frame: odom* /gmapping/ogain: 3.0* /gmapping/particles: 100* /gmapping/resampleThreshold: 0.5* /gmapping/sigma: 0.05* /gmapping/srr: 0.1* /gmapping/srt: 0.2* /gmapping/str: 0.1* /gmapping/stt: 0.2* /gmapping/temporalUpdate: 0.5* /gmapping/xmax: 10.0* /gmapping/xmin: -10.0* /gmapping/ymax: 10.0* /gmapping/ymin: -10.0* /rosdistro: melodic* /rosversion: 1.14.10* /rplidarNode/angle_compensate: True* /rplidarNode/frame_id: base_laser_link* /rplidarNode/inverted: False* /rplidarNode/serial_baudrate: 115200* /rplidarNode/serial_port: /dev/rplidar* /rplidarNode/smart_control: True* /use_sim_time: FalseNODES/base_control (base_control/base_control.py)base_footprint_to_laser (tf/static_transform_publisher)gmapping (gmapping/slam_gmapping)rplidarNode (rplidar_ros/rplidarNode)auto-starting new master
process[master]: started with pid [26860]
ROS_MASTER_URI=http://192.168.0.110:11311setting /run_id to 0d9eb03a-92d4-11ec-93b6-ac8247315e93
process[rosout-1]: started with pid [26872]
started core service [/rosout]
process[base_control-2]: started with pid [26880]
process[rplidarNode-3]: started with pid [26881]
process[base_footprint_to_laser-4]: started with pid [26882]
[ INFO] [1645420003.466982431]: RPLIDAR running on ROS package rplidar_ros. SDK Version:1.12.0
process[gmapping-5]: started with pid [26888]
[INFO] [1645420005.904613]: NanoCar_Pro base control ...
[INFO] [1645420005.930990]: Opening Serial
[INFO] [1645420005.934433]: Serial Open Succeed
RPLIDAR S/N: B2BA9A86C0E09CC7A2E09DF720683077
[ INFO] [1645420005.990420997]: Firmware Ver: 1.29
[ INFO] [1645420005.990503339]: Hardware Rev: 7
[ INFO] [1645420005.991967162]: RPLidar health status : 0
[ INFO] [1645420006.037426077]: current scan mode: Sensitivity, max_distance: 12.0 m, Point number: 7.9K , angle_compensate: 2
[INFO] [1645420006.511063]: Move Base Hardware Ver 2.1.0,Firmware Ver 2.1.3
[INFO] [1645420006.584277]: SN:002b00413138511532323338
[INFO] [1645420006.588490]: Type:RC_ACKERMAN Motor:RS365 Ratio:11.0 WheelDiameter:72.0
[ INFO] [1645420007.293346325]: Laser is mounted upwards.-maxUrange 5 -maxUrange 11.99 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05-srr 0.1 -srt 0.2 -str 0.1 -stt 0.2-linearUpdate 1 -angularUpdate 0.2 -resampleThreshold 0.5-xmin -10 -xmax 10 -ymin -10 -ymax 10 -delta 0.05 -particles 100
[ INFO] [1645420007.299853112]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 0
Registering First Scan
update frame 7
update ld=1.38778e-17 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 1
Average Scan Matching Score=478.584
neff= 100
Registering Scans:Done
update frame 8
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 2
Average Scan Matching Score=454.423
neff= 100
Registering Scans:Done
update frame 9
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 3
Average Scan Matching Score=470.991
neff= 100
Registering Scans:Done
update frame 10
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 4
Average Scan Matching Score=456.326
neff= 100
Registering Scans:Done
update frame 11
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 5
^C[gmapping-5] killing on exit
[rplidarNode-3] killing on exit
[base_footprint_to_laser-4] killing on exit
[base_control-2] killing on exit
Average Scan Matching Score=468.525
neff= 100
Registering Scans:Done
update frame 12
update ld=0 ad=0
Laser Pose= 0.1037 0 -3.13287
m_count 6
Average Scan Matching Score=457.468
neff= 100
Registering Scans:Done
virtual GMapping::GridSlamProcessor::~GridSlamProcessor(): Start
virtual GMapping::GridSlamProcessor::~GridSlamProcessor(): Deleting tree
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
gmapping 是机器人的建图算法节点。
rplidarNode是雷达节点。
base_footprint_to_laser是激光雷达到底盘的坐标转换节点。
base_control是底盘控制节点。
@ubuntu:~$ rosnode list
/base_control
/base_footprint_to_laser
/gmapping
/rosout
/rplidarNode
@ubuntu:~$ rostopic list
/battery
/cmd_vel
/gmapping/entropy
/map
/map_metadata
/odom
/rosout
/rosout_agg
/scan
/tf
/tf_static

在这里插入图片描述

在这里插入图片描述

@ubuntu:~$ rostopic info /map
Type: nav_msgs/OccupancyGridPublishers: * /gmapping (http://192.168.0.110:38195/)Subscribers: None@ubuntu:~$ rostopic echo /map
出现一堆

在这里插入图片描述

@ubuntu:~$ rostopic info /gmapping/entropy
Type: std_msgs/Float64Publishers: * /gmapping (http://192.168.0.110:38195/)Subscribers: None@ubuntu:~$ rostopic echo /gmapping/entropy
data: 4.60516902161
---
data: 4.60516902835
---
data: 4.60516903552
---
data: 4.60516903771
---
有cartographer、hector、karto、gmapping 四种常见的建图算法。切换:
robot:缺省为gmappingroslaunch robot_navigation robot_slam_laser.launch slam_methods:=hectorroslaunch robot_navigation robot_slam_laser.launch slam_methods:=cartographerroslaunch robot_navigation robot_slam_laser.launch slam_methods:=karto
全局路径规划是机器人起点和目标点之间的完整的路径规划。不是机器人可以立刻执行的路径,比如阿克曼结构无法原地转向。此时需用局部路径规划器对全局路径规划进行动态调整。局部路径规划算法:激光雷达导航:robot:roslaunch robot_navigation robot_navigation.launch默认使用的是 TEB 路径规划器,考虑到了机器人最小转向半径,适合阿克曼结构。roslaunch robot_navigation robot_slam_laser.launch planner:=tebdwa 算法可以实现原地转,适合差速转向结构。roslaunch robot_navigation robot_navigation.launch planner:=dwa无地图场景下导航并建图:
robot:roslaunch robot_navigation robot_slam_laser.launch planner:=teb
pc:roslaunch robot_navigation slam_rviz.launch
pc:2D Nav Goal给定目标点,导航过程中不断完善地图。保存地图:
robot:roscd robot_navigation/maps
robot:rosrun map_server map_saver -f map

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

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

相关文章

ROS 找C++算法源码的方法

在gmapping的launch文件中看到&#xff0c;type“slam_gmapping”&#xff0c;这里的slam_gmapping是c编译后的可执行文件。 如果想要修改gmapping算法&#xff0c;就需要找到slam_gmapping的c源码。 但是这是用apt下载的包&#xff0c;是二进制类型的&#xff0c;没有下载出…

ros 雷达 slam 导航 文件分析

ros 雷达 slam 导航 文件分析robot_slam_laser.launchrobot_lidar.launchlidar.launchraplidar.launchkarto.launchgmapping.launchcartographer.launchrobot_navigation.launchmap.yamlmap.pgmamcl_params.yamlmove_base.launchcostmap_common_params.yamllocal_costmap_param…

Apprentissage du français partie 1

Apprentissage du franais partie 1 键盘转换图&#xff1a; 字母&#xff1a;26个 元音字母&#xff1a;a、e、i、o、u、y b浊辅音(声带)-p清辅音 d-t 音符 音符&#xff1a;改变字母发音。 &#xff1a;闭音符 [e] &#xff1a;开音符 /ε/ &#xff1a;长音符 /ε/…

stm32基本定时器

定时器分类 stm32f1系列&#xff0c;8个定时器&#xff0c;基本定时器(TIM6,7)、通用定时器(TIM2,3,4,5)、高级定时器(TIM1,8)。 基本定时器&#xff1a;16位&#xff0c;只能向上计数的定时器&#xff0c;只能定时&#xff0c;没有外部IO 通用定时器&#xff1a;16位&#…

stm32高级定时器 基础知识

stm32高级定时器 高级定时器时基单元&#xff1a; 包含一个16位自动重装载寄存器 ARR 一个16位的计数器CNT&#xff0c;可向上/下计数 一个16位可编程预分频器PSC&#xff0c;预分频器时钟源有多种可选&#xff0c;有内部的时钟、外部时钟。 一个8位的重复计数器 RCR&…

stm32 PWM互补输出

stm32高级定时器例子—stm32 PWM互补输出 定时器初始化结构体 TIM_TimeBaseInitTypeDef 时基结构体&#xff0c;用于定时器基础参数设置&#xff0c;与TIM_TimeBaseInit函数配合使用&#xff0c;完成配置。 typedef struct { TIM_Prescaler /*定时器预分频器设置&…

stm32 输入捕获 测量脉宽

选用通用定时器TIM5的CH1。 PA0接一个按键&#xff0c;默认接GND&#xff0c;当按键按下时&#xff0c;IO口被拉高&#xff0c;此时&#xff0c;可利用定时器的输入捕获功能&#xff0c;测量按键按下的这段高电平的时间。 宏定义方便程序升级、移植&#xff0c;举个例子&#…

stm32 PWM输入捕获

普通的输入捕获&#xff0c;可使用定时器的四个通道&#xff0c;一路捕获占用一个捕获寄存器. PWM输入&#xff0c;只能使用两个通道&#xff0c;通道1和通道2。 一路PWM输入占用两个捕获寄存器&#xff0c;一个捕获周期&#xff0c;一个捕获占空比。 这里&#xff0c;用通用…

直流有刷减速电机结构及其工作原理

寒假无聊拆了个直流有刷减速电机。下面介绍一下它的结构和工作原理 直流电机 直流电机和直流减速电机&#xff1a; 构造上相差的是一个减速齿轮组。 普通的直流电机当空载时&#xff0c;电机的转速由电压决定&#xff0c;直流减速电机的转速由齿轮组和电压决定。 齿轮组作…

数据库基础概念

postgreSQL设置只允许本地机器连接 在D:\program files\PostgreSQL\14\data里面设置postgresql.conf&#xff1a; listen_addresses ‘localhost’ 然后在服务窗口重新启动postgresql。 PostgreSQL执行SQL语句 PostgreSQL的psql工具可通过命令行执行SQL语句。 psql -U po…

电机和驱动的种类

电机种类 直流电机 分为普通的直流电机、直流减速电机、有刷、无刷。 直流有刷减速电机参数&#xff1a; 空载转速&#xff0c;正常工作电压&#xff0c;电机不带任何负载的转速。 空载电流&#xff0c;正常工作电压&#xff0c;电机不带任何负载的工作电流。单位mA。 负载…

Linux shell基础知识

Shell简介 Shell是一个应用程序&#xff0c;接收用户输入的命令&#xff0c;根据命令做出相应动作。 Shell负责将应用层或者用户输入的命令&#xff0c;传递给系统内核。由操作系统内核&#xff0c;来完成相应的工作。然后将结果反馈给应用层或者用户。 shell命令格式&#…

Linux APT VIM 的一些指令

APT APT下载工具&#xff0c;可以实现软件自动下载、配置、安装二进制或源码功能。 APT采用客户端/服务器模式。 sudo apt-get update 更新软件 sudo apt-get check 检查依赖关系 sudo apt-get install package-name 安装软件 apt-get负责下载软件&#xff0c;install负责安…

CATIA 界面介绍

窗口介绍 窗口主要有&#xff1a;菜单栏、工具栏、特征树、罗盘、信息栏、图形区。 菜单栏&#xff0c;开始里面有CATIA的各个功能模块。 图形区&#xff0c;进行3D、2D设计的图形创建、编辑区域。 信息栏&#xff0c;显示用户即将进行操作的文字提示。 工具栏&#xff0c;…

Linux C文件编译

设置编辑器 1.TAB键设置为4空格。 首先用vim打开/etc/vim/vimrc文件&#xff0c;这里面发现root用户才能修改vimrc文件&#xff0c;所以用sudo命令暂时切换到root用户。 在vimrc文件最后面&#xff0c;输入set ts 4完成设置。 然后保存&#xff0c;关闭文件。 2.VIM编辑器显…

catia 草图设计

草图设计界面 进入草图编辑器环境&#xff1a; 菜单栏&#xff0c;文件-新建&#xff0c;然后类型选择Part。 工具栏&#xff0c;点击下面草图按钮。 然后选择草图平面。 然后就进入草图界面。 草图界面主要由菜单栏、工具栏、特征树、信息栏、罗盘、图形区组成。 菜单栏&…

CATIA连接盘实体设计

文件-新建-part。 点击草图按钮&#xff0c;选择xy平面&#xff0c;绘制如下草图。 然后用橡皮擦修改一下。 然后&#xff0c;点击凸台按钮。选择刚刚定义的草图&#xff0c;拉伸20mm。 选择拉伸实体上端面&#xff0c;点击草图按钮&#xff0c;进入草图编辑器。 在草图编辑器…

PostgreSQL 表的创建、删除、更新

psql工具 psql工具&#xff0c;可通过命令行执行SQL语句。 D:\program files\PostgreSQL\14\bin>psql -U postgres 用户 postgres 的口令&#xff1a; psql (14.2) 输入 "help" 来获取帮助信息.postgres#创建数据库 创建表之前&#xff0c;先创建存储表的数据库…

PostgreSQL 简单的查询

查询列 SELECT语句&#xff0c;用于从表中选取数据。 格式&#xff1a; SELECT <列名>,... FROM <表名>;从Product表中&#xff0c;查询三列。 SELECT product_id, product_name, purchase_price FROM Product;查询所有列&#xff0c;格式&#xff1a; SELECT …

PostgreSQL 聚合、分组、排序

聚合函数 用于汇总的函数。 COUNT COUNT&#xff0c;计算表中的行数(记录数)。 计算全部数据的行数&#xff1a; SELECT COUNT(*)FROM Product;NULL之外的数据行数&#xff1a; SELECT COUNT(purchase_price)FROM Product;结果如下图。 对于一个含NULL的表&#xff1a; …