Skip to content

Commit

Permalink
Update README & fix launch files for Foxy and up (#26)
Browse files Browse the repository at this point in the history
* Update README.md

based on modifications from youngday

* Update launch files for Foxy or later
  • Loading branch information
z-jesse authored Sep 6, 2022
1 parent 81009a2 commit fe24d1d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 39 deletions.
38 changes: 15 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RPLIDAR ROS package
RPLIDAR ROS 2 Package
=====================================================================

ROS node and test application for RPLIDAR
Expand All @@ -13,39 +13,31 @@ rplidar SDK: https://github.com/Slamtec/rplidar_sdk

rplidar Tutorial: https://github.com/robopeak/rplidar_ros/wiki

How to build rplidar ros package
Getting Started
=====================================================================
1) Clone this project to your catkin's workspace src folder
2) Running catkin_make to build rplidarNode and rplidarNodeClient
1) Clone this project to your colcon workspace src folder.
2) Build the package: ```colcon build --symlink-install```

How to run rplidar ros package
Running the Package
=====================================================================
There're two ways to run rplidar ros package
There are two ways to run the RPLIDAR ROS 2 Package.

I. Run rplidar node and view in the rviz
------------------------------------------------------------
roslaunch rplidar_ros view_rplidar.launch (for RPLIDAR A1/A2)
,
roslaunch rplidar_ros view_rplidar_a3.launch (for RPLIDAR A3)
or
roslaunch rplidar_ros view_rplidar_s1.launch (for RPLIDAR S1)
RPLIDAR A1/A2: ```ros2 launch rplidar_ros view_rplidar.launch.py```

You should see rplidar's scan result in the rviz.
RPLIDAR A3: ```ros2 launch rplidar_ros view_rplidar_a3.launch.py```

RPLIDAR S1: ```ros2 launch rplidar_ros view_rplidar_s1.launch.py```

II. Run rplidar node and view using test application
------------------------------------------------------------
roslaunch rplidar_ros rplidar.launch (for RPLIDAR A1/A2)
,
roslaunch rplidar_ros rplidar_a3.launch (for RPLIDAR A3)
or
roslaunch rplidar_ros rplidar_s1.launch (for RPLIDAR S1)

rosrun rplidar_ros rplidarNodeClient
RPLIDAR A1/A2: ```ros2 launch rplidar_ros rplidar.launch.py``` OR ```ros2 run rplidar_ros rplidar_composition```

You should see rplidar's scan result in the console
RPLIDAR A3: ```ros2 launch rplidar_ros rplidar_a3.launch.py```

Notice: the different is serial_baudrate between A1/A2 and A3/S1
RPLIDAR S1: ```ros2 launch rplidar_ros rplidar_s1.launch.py```

RPLidar frame
Frame Orientation
=====================================================================
RPLidar frame must be broadcasted according to picture shown in rplidar-frame.png
<img src="rplidar_A1.png" alt="" height="300"/><img src="rplidar_A2.png" alt="" height="300"/>
4 changes: 2 additions & 2 deletions launch/rplidar.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def generate_launch_description():
return LaunchDescription([
Node(
node_name='rplidar_composition',
name='rplidar_composition',
package='rplidar_ros',
node_executable='rplidar_composition',
executable='rplidar_composition',
output='screen',
parameters=[{
'serial_port': '/dev/ttyUSB0',
Expand Down
4 changes: 2 additions & 2 deletions launch/rplidar_a3.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def generate_launch_description():
return LaunchDescription([
Node(
node_name='rplidar_composition',
name='rplidar_composition',
package='rplidar_ros',
node_executable='rplidar_composition',
executable='rplidar_composition',
output='screen',
parameters=[{
'serial_port': '/dev/ttyUSB0',
Expand Down
4 changes: 2 additions & 2 deletions launch/rplidar_s1.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def generate_launch_description():
return LaunchDescription([
Node(
node_name='rplidar_composition',
name='rplidar_composition',
package='rplidar_ros',
node_executable='rplidar_composition',
executable='rplidar_composition',
output='screen',
parameters=[{
'serial_port': '/dev/ttyUSB0',
Expand Down
4 changes: 2 additions & 2 deletions launch/rplidar_s1_tcp.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def generate_launch_description():
return LaunchDescription([
Node(
node_name='rplidar_composition',
name='rplidar_composition',
package='rplidar_ros',
node_executable='rplidar_composition',
executable='rplidar_composition',
output='screen',
parameters=[{
'channel_type': 'tcp',
Expand Down
8 changes: 4 additions & 4 deletions launch/test_rplidar_a3.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
def generate_launch_description():
return LaunchDescription([
Node(
node_name='rplidar_composition',
name='rplidar_composition',
package='rplidar_ros',
node_executable='rplidar_composition',
executable='rplidar_composition',
output='screen',
parameters=[{
'serial_port': '/dev/ttyUSB0',
Expand All @@ -19,9 +19,9 @@ def generate_launch_description():
}],
),
Node(
node_name='rplidarNodeClient',
name='rplidarNodeClient',
package='rplidar_ros',
node_executable='rplidarNodeClient',
executable='rplidarNodeClient',
output='screen',
),
])
2 changes: 1 addition & 1 deletion launch/view_rplidar.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate_launch_description():
IncludeLaunchDescription(PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/rplidar.launch.py'])),
Node(
package='rviz2',
node_executable='rviz2',
executable='rviz2',
output='screen',
arguments=['-d', [ThisLaunchFileDir(), '/../rviz/rplidar.rviz']],
)
Expand Down
2 changes: 1 addition & 1 deletion launch/view_rplidar_a3.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate_launch_description():
IncludeLaunchDescription(PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/rplidar_a3.launch.py'])),
Node(
package='rviz2',
node_executable='rviz2',
executable='rviz2',
output='screen',
arguments=['-d', [ThisLaunchFileDir(), '/../rviz/rplidar.rviz']],
)
Expand Down
2 changes: 1 addition & 1 deletion launch/view_rplidar_s1.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate_launch_description():
IncludeLaunchDescription(PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/rplidar_s1.launch.py'])),
Node(
package='rviz2',
node_executable='rviz2',
executable='rviz2',
output='screen',
arguments=['-d', [ThisLaunchFileDir(), '/../rviz/rplidar.rviz']],
)
Expand Down
2 changes: 1 addition & 1 deletion launch/view_rplidar_s1_tcp.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate_launch_description():
IncludeLaunchDescription(PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/rplidar_s1_tcp.launch.py'])),
Node(
package='rviz2',
node_executable='rviz2',
executable='rviz2',
output='screen',
arguments=['-d', [ThisLaunchFileDir(), '/../rviz/rplidar.rviz']],
)
Expand Down

0 comments on commit fe24d1d

Please sign in to comment.