-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/support multiple mini pupper model (#93)
* tidy up bring up and gazebo launch files * futher clean up code * minor syntax tidy up * tidy up for review
- Loading branch information
Showing
11 changed files
with
238 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sensors: | ||
lidar: true | ||
imu: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sensors: | ||
lidar: true | ||
imu: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (c) 2022-2023 MangDang | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
|
||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch_ros.substitutions import FindPackageShare | ||
from launch.conditions import IfCondition | ||
|
||
|
||
def generate_launch_description(): | ||
has_lidar = LaunchConfiguration("has_lidar") | ||
has_lidar_launch_arg = DeclareLaunchArgument( | ||
name='has_lidar', | ||
description='if the robot has lidar sensor' | ||
) | ||
|
||
has_imu = LaunchConfiguration("has_imu") | ||
has_imu_launch_arg = DeclareLaunchArgument( | ||
name='has_imu', | ||
description='if the robot has imu sensor' | ||
) | ||
|
||
driver_package = FindPackageShare('mini_pupper_driver') | ||
|
||
servos_launch_path = PathJoinSubstitution( | ||
[driver_package, 'launch', 'servo_interface.launch.py'] | ||
) | ||
lidar_launch_path = PathJoinSubstitution( | ||
[driver_package, 'launch', 'lidar_ld06.launch.py'] | ||
) | ||
imu_launch_path = PathJoinSubstitution( | ||
[driver_package, 'launch', 'imu_interface.launch.py'] | ||
) | ||
|
||
return LaunchDescription([ | ||
has_lidar_launch_arg, | ||
has_imu_launch_arg, | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource(servos_launch_path) | ||
), | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource(lidar_launch_path), | ||
condition=IfCondition(has_lidar) | ||
), | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource(imu_launch_path), | ||
condition=IfCondition(has_imu) | ||
) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Copyright (c) 2022-2023 MangDang | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from launch import LaunchDescription | ||
from launch.substitutions import PathJoinSubstitution | ||
from launch_ros.substitutions import FindPackageShare | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
description_package = FindPackageShare('mini_pupper_description') | ||
|
||
rviz_config_path = PathJoinSubstitution( | ||
[description_package, 'rviz', 'urdf_viewer.rviz'] | ||
) | ||
|
||
return LaunchDescription([ | ||
Node( | ||
package="rviz2", | ||
namespace="", | ||
executable="rviz2", | ||
name="rviz2", | ||
arguments=["-d", rviz_config_path] | ||
) | ||
]) |
File renamed without changes.
Oops, something went wrong.