Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rviz param dir and fix readme #77

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
])