Skip to content

Commit

Permalink
Add rviz param dir and fix readme (#77)
Browse files Browse the repository at this point in the history
Signed-off-by: Taiga Takano <ttttghghnb554z@outlook.jp>
  • Loading branch information
TakanoTaiga authored Sep 11, 2023
1 parent 15bd077 commit b657c7b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rosdep install --from-paths src --ignore-src -r -y
```
build
```
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
```

## io
Expand Down Expand Up @@ -126,9 +126,7 @@ ros2 service call /map_save std_srvs/Empty
demo data(ROS1) is `hdl_400.bag` in [hdl_graph_slam](https://github.com/koide3/hdl_graph_slam)
The Velodyne VLP-32 was used in this data.
To use rosbag in ROS1, use [rosbag2_bag_v2](https://github.com/ros2/rosbag2_bag_v2)
```
rviz2 -d src/lidarslam_ros2/lidarslam/rviz/mapping.rviz
```


```
ros2 launch lidarslam lidarslam.launch.py
Expand All @@ -151,10 +149,6 @@ https://data.tier4.jp/rosbag_details/?id=212
The Velodyne VLP-16 was used in this data.


```
rviz2 -d src/lidarslam_ros2/lidarslam/rviz/mapping_tukuba.rviz
```

```
ros2 launch lidarslam lidarslam_tukuba.launch.py
```
Expand Down
2 changes: 1 addition & 1 deletion lidarslam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ament_target_dependencies(lidarslam
)

install(
DIRECTORY launch param
DIRECTORY launch param rviz
DESTINATION share/${PROJECT_NAME}
)

Expand Down
14 changes: 14 additions & 0 deletions lidarslam/launch/lidarslam.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ def generate_launch_description():
get_package_share_directory('lidarslam'),
'param',
'lidarslam.yaml'))

rviz_param_dir = launch.substitutions.LaunchConfiguration(
'rviz_param_dir',
default=os.path.join(
get_package_share_directory('lidarslam'),
'rviz',
'mapping.rviz'))

mapping = launch_ros.actions.Node(
package='scanmatcher',
Expand All @@ -35,6 +42,12 @@ def generate_launch_description():
parameters=[main_param_dir],
output='screen'
)

rviz = launch_ros.actions.Node(
package='rviz2',
executable='rviz2',
arguments=['-d', rviz_param_dir]
)


return launch.LaunchDescription([
Expand All @@ -45,4 +58,5 @@ def generate_launch_description():
mapping,
tf,
graphbasedslam,
rviz,
])
14 changes: 14 additions & 0 deletions lidarslam/launch/lidarslam_tukuba.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ def generate_launch_description():
get_package_share_directory('lidarslam'),
'param',
'lidarslam_tukuba.yaml'))

rviz_param_dir = launch.substitutions.LaunchConfiguration(
'rviz_param_dir',
default=os.path.join(
get_package_share_directory('lidarslam'),
'rviz',
'mapping_tukuba.rviz'))

mapping = launch_ros.actions.Node(
package='scanmatcher',
Expand All @@ -36,6 +43,12 @@ def generate_launch_description():
)


rviz = launch_ros.actions.Node(
package='rviz2',
executable='rviz2',
arguments=['-d', rviz_param_dir]
)

return launch.LaunchDescription([
launch.actions.DeclareLaunchArgument(
'main_param_dir',
Expand All @@ -44,4 +57,5 @@ def generate_launch_description():
mapping,
graphbasedslam,
tf,
rviz,
])

0 comments on commit b657c7b

Please sign in to comment.