Skip to content
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
70 changes: 70 additions & 0 deletions examples/dave_demos/launch/lidar_3d_demo.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription

Check failure on line 4 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L4

'launch.actions.DeclareLaunchArgument' imported but unused (F401)
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node

def generate_launch_description():

Check failure on line 8 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L8

Expected 2 blank lines, found 1 (E302)
# 1. Paths to your new assets
pkg_dave_worlds = get_package_share_directory('dave_worlds')
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim')

Check failure on line 11 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L11

Local variable 'pkg_ros_gz_sim' is assigned to but never used (F841)
pkg_dave_demos = get_package_share_directory('dave_demos')

# Path to your new world file
world_path = os.path.join(pkg_dave_worlds, 'worlds', 'lidar_3d.world')

# 2. Launch Gazebo with the new world
# We include the standard Gazebo Sim launch but pass our custom world
gz_sim = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_dave_demos, 'launch', "dave_sensor.launch.py")
),
launch_arguments={
"namespace": "lidar_3d",
"world_name": "lidar_3d",
"paused": "false",
"debug": "true",
"x": "5.8",
"z": "2",
"yaw": "3.14",
'gz_args': f'-r {world_path} --render-engine ogre2'
}.items(),
)

# This replaces the DAVE multibeam bridge with one for your 3D LiDAR
bridge = Node(
package='ros_gz_bridge',
executable='parameter_bridge',
arguments=[
# LiDAR LaserScan
'/lidar@sensor_msgs/msg/LaserScan[gz.msgs.LaserScan',
# LiDAR PointCloud
'/lidar/points@sensor_msgs/msg/PointCloud2[gz.msgs.PointCloudPacked',
# Clock bridge (essential for TF and sensor timing)
'/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'
],
remappings=[
('/lidar', '/lidar_3d/lidar'),

Check failure on line 48 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L48

Continuation line missing indentation or outdented (E122)
('/lidar/points', '/lidar_3d/lidar/points')

Check failure on line 49 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L49

Continuation line missing indentation or outdented (E122)
],
output='screen'
)

# Connects the sensor frame to the world frame for RViz visualization
tf_node = Node(
package='tf2_ros',

Check failure on line 56 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L56

Continuation line missing indentation or outdented (E122)
executable='static_transform_publisher',

Check failure on line 57 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L57

Continuation line missing indentation or outdented (E122)
arguments=[

Check failure on line 58 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L58

Continuation line missing indentation or outdented (E122)
'--x', '0', '--y', '0', '--z', '0.5',
'--roll', '0', '--pitch', '0', '--yaw', '0',
'--frame-id', 'world',
'--child-frame-id', 'lidar_3d/lidar_3d_base_link/gpu_lidar'
],
)

Check failure on line 64 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L64

Continuation line missing indentation or outdented (E122)

return LaunchDescription([
gz_sim,
bridge,
tf_node
])

Check failure on line 70 in examples/dave_demos/launch/lidar_3d_demo.launch.py

View workflow job for this annotation

GitHub Actions / Flake8

examples/dave_demos/launch/lidar_3d_demo.launch.py#L70

No newline at end of file (W292)
Loading
Loading