Robot Hardware Components and Programming: Unterschied zwischen den Versionen

Aus HSHL Mechatronik
Zur Navigation springen Zur Suche springen
Zeile 29: Zeile 29:


Now, LaserScan messages ought to be being published by the driver node. We can once again utilize RViz to verify this. We'll need to manually define the fixed frame by typing in laser_frame if robot_state_publisher isn't functioning.
Now, LaserScan messages ought to be being published by the driver node. We can once again utilize RViz to verify this. We'll need to manually define the fixed frame by typing in laser_frame if robot_state_publisher isn't functioning.
==== RPLidar Intrgration and Programming ====
==== RPLidar Integration and Programming ====

Version vom 6. Januar 2023, 15:51 Uhr

The AplphBot is modified with a RPLidar is used for this project. Raspberry pi 4 is used as a computer with Odometer sensor and motor driver L298P is used.

IMG AlphaBot

Raspberry Pi 4 is installed with Linux server and established a SSH connection with the robot and PC.

Please go through the documentation here for the steps: How to install Ubuntu Server on your Raspberry Pi

Then ROS2 is installed in raspberry pi through SSH

RPLidar Intrgration and Programming

Now that we have the driver software, we can post a LaserScan topic and communicate with the laser. Actually, there are a few distinct versions of the driver available. We are utilizing the package repository version in this instance. To install the package,

> sudo apt install ros-foxy-rplidar-ros <

Therefore, we must run the driver next. Currently, for the version that is installed on the apt repo, the package name is rplidar ros, and the node name is rplidar_composition. Several further optional settings must also be set.

  • -p serial_port:=/dev/ttyUSB0 - The serial port the lidar
  • -p frame_id:=lidar_link - The transform frame of the lidar
  • -p angle_compensate:=true - Simply turn this setting on, please. If you don't turn it on, even though it appears to be on, it won't function properly.
  • -p scan_mode:=Standard - What scan mode the lidar is in, how many points there are, and other things are controlled

Then the final commond is

> ros2 run rplidar_ros rplidar_composition --ros-args -p serial_port:=/dev/ttyUSB0 -p frame_id:=lidar_link -p angle_compensate:=true -p scan_mode:=Standard
<

Now, LaserScan messages ought to be being published by the driver node. We can once again utilize RViz to verify this. We'll need to manually define the fixed frame by typing in laser_frame if robot_state_publisher isn't functioning.

RPLidar Integration and Programming