use upstream livvox_ros-driver2 package

This commit is contained in:
Matt Spencer
2026-07-11 21:22:21 +01:00
parent d8c1bc3cca
commit fc0dc5746c
97 changed files with 63 additions and 25466 deletions
@@ -0,0 +1,41 @@
{
"lidar_summary_info": {
"lidar_type": 8
},
"MID360": {
"lidar_net_info": {
"cmd_data_port": 56100,
"push_msg_port": 56200,
"point_data_port": 56300,
"imu_data_port": 56400,
"log_data_port": 56500
},
"host_net_info": {
"cmd_data_ip": "192.168.1.50",
"cmd_data_port": 56101,
"push_msg_ip": "192.168.1.50",
"push_msg_port": 56201,
"point_data_ip": "192.168.1.50",
"point_data_port": 56301,
"imu_data_ip": "192.168.1.50",
"imu_data_port": 56401,
"log_data_ip": "",
"log_data_port": 56501
}
},
"lidar_configs": [
{
"ip": "192.168.1.3",
"pcl_data_type": 1,
"pattern_mode": 0,
"extrinsic_parameter": {
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0,
"x": 0,
"y": 0,
"z": 0
}
}
]
}
@@ -0,0 +1,94 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch.substitutions import LaunchConfiguration, PythonExpression
from launch_ros.actions import Node
################### user configure parameters for ros2 start ###################
# xfer_format = 0 # 0-Pointcloud2(PointXYZRTL), 1-customized pointcloud format
multi_topic = 0 # 0-All LiDARs share the same topic, 1-One LiDAR one topic
data_src = 0 # 0-lidar, others-Invalid data src
# publish_freq = 10.0 # freqency of publish, 5.0, 10.0, 20.0, 50.0, etc.
output_type = 0
frame_id = 'laser_link'
lvx_file_path = '/home/livox/livox_test.lvx'
cmdline_bd_code = 'livox0000000001'
# AGV-specific config lives in this package so the upstream livox_ros_driver2
# install can stay in its vanilla state.
cur_path = os.path.split(os.path.realpath(__file__))[0] + '/'
cur_config_path = cur_path + '../config'
user_config_path = os.path.join(cur_config_path, 'MID360_config.json')
# The RViz config is provided by the (vanilla) upstream livox_ros_driver2 package.
rviz_config_path = os.path.join(
get_package_share_directory('livox_ros_driver2'),
'config', 'display_point_cloud_ROS2.rviz')
################### user configure parameters for ros2 end #####################
def generate_launch_description():
use_mid360_rviz = LaunchConfiguration('use_mid360_rviz')
xfer_format = LaunchConfiguration('xfer_format')
publish_freq = LaunchConfiguration('publish_freq')
declare_rviz_arg = DeclareLaunchArgument(
'use_mid360_rviz',
default_value='false',
description='Enable RViz for MID360 LiDAR visualization'
)
declare_xfer_format_arg = DeclareLaunchArgument(
'xfer_format',
default_value='0',
description='MID360 format: 0=Pointcloud2(PointXYZRTL), 1=customized pointcloud format'
)
declare_publish_freq_arg = DeclareLaunchArgument(
'publish_freq',
default_value='10.0',
description='MID360 LiDAR publish frequency in Hz (e.g., 5.0, 10.0, 20.0, 50.0)'
)
livox_ros2_params = [
{"xfer_format": xfer_format},
{"multi_topic": multi_topic},
{"data_src": data_src},
{"publish_freq": publish_freq},
{"output_data_type": output_type},
{"frame_id": frame_id},
{"lvx_file_path": lvx_file_path},
{"user_config_path": user_config_path},
{"cmdline_input_bd_code": cmdline_bd_code}
]
livox_driver = Node(
package='livox_ros_driver2',
executable='livox_ros_driver2_node',
name='livox_lidar_publisher',
output='screen',
parameters=livox_ros2_params
)
livox_rviz = Node(
package='rviz2',
executable='rviz2',
name='mid360_lidar_rviz',
output='screen',
arguments=['--display-config', rviz_config_path],
condition=IfCondition(
PythonExpression([
"'", use_mid360_rviz, "' == 'true' and '",
xfer_format, "' == '0'"
])
)
)
return LaunchDescription([
declare_rviz_arg,
declare_xfer_format_arg,
declare_publish_freq_arg,
livox_driver,
livox_rviz,
])
@@ -99,7 +99,7 @@ def generate_launch_description():
lidar_launchs = [
include_lidar('lslidar_driver', 'lsn10p_launch.py', enable_lidar, lidar_type, 'n10p'),
include_lidar('livox_ros_driver2', 'MID360_launch.py',enable_lidar, lidar_type, 'mid360'),
include_lidar('agv_pro_bringup', 'MID360_launch.py',enable_lidar, lidar_type, 'mid360'),
include_lidar('unitree_lidar_ros2', 'launch.py', enable_lidar, lidar_type, 'l2'),
]
@@ -14,6 +14,7 @@
<exec_depend>agv_pro_description</exec_depend>
<exec_depend>agv_pro_base</exec_depend>
<exec_depend>cartographer_ros</exec_depend>
<exec_depend>livox_ros_driver2</exec_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>