SICKAG / sick_scan_xd

A versatile driver for a wide range of SICK LiDAR and RADAR devices, providing support for both Linux (native, ROS 1, ROS 2) and Windows (native, ROS 2) platforms.
Apache License 2.0
111 stars 85 forks source link

Sick PicoScan150 "add_transform_xyz_rpy" not working #399

Closed ravikiransama closed 1 month ago

ravikiransama commented 1 month ago

Hi, I have an issue with sick pico scan 150. The "add_transform_xyz_rpy" is not working. The moment i enter non zero values, no point clouds are published on that topic in rviz. I use ros2 humble and sick_scan_xd humble version. I had built the sick scan from source.

Here are my launch and config files. `<?xml version="1.0"?>

import os import sys from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch_ros.actions import Node from launch.actions import DeclareLaunchArgument

def generate_launch_description():

ld = LaunchDescription()
sick_scan_pkg_prefix = get_package_share_directory('sick_scan_xd')
launchfile = os.path.basename(__file__)[:-3] # convert "<lidar_name>.launch.py" to "<lidar_name>.launch"
launch_file_path = os.path.join(sick_scan_pkg_prefix, 'launch/' + launchfile) # 'launch/sick_picoscan.launch')
node_arguments=[launch_file_path]

# append optional commandline arguments in name:=value syntax
for arg in sys.argv:
    if len(arg.split(":=")) == 2:
        node_arguments.append(arg)

ROS_DISTRO = os.environ.get('ROS_DISTRO') # i.e. 'eloquent', 'foxy', etc.
if ROS_DISTRO[0] <= "e": # ROS versions eloquent and earlier require "node_executable", ROS foxy and later use "executable"
    node = Node(
        package='sick_scan_xd',
        node_executable='sick_generic_caller',
        output='screen',
        arguments=node_arguments
    )
else: # ROS versions eloquent and earlier require "node_executable", ROS foxy and later use "executable"
    node = Node(
        package='sick_scan_xd',
        executable='sick_generic_caller',
        output='screen',
        arguments=node_arguments
    )

ld.add_action(node)
return ld

<?xml version="1.0"?>

`

rostest commented 1 month ago

Thank you for your feedback. Due to a configuration issue, the full frame point clouds are not published if the configured rotation is only about the z axis (i.e. roll=0, pitch=0, yaw!=0). Please use the update provided in branch https://github.com/SICKAG/sick_scan_xd/tree/feature/issue_update_2407xx (driver/src/sick_scansegment_xd/config.cpp modified), rebuild and run again.

Note that the parameter "add_transform_xyz_rpy" expects 6 comma separated values. Please replace <param name="add_transform_xyz_rpy" type="string" value="0.398 -0.213 0.12,0,0,-0.785398" /> (missing commas) with <param name="add_transform_xyz_rpy" type="string" value="0.398,-0.213,0.12,0,0,-0.785398" /> (or any other transform you want to apply) in your launch file.

ravikiransama commented 1 month ago

Thank you for the suggestion. It works now with the update in the branch. Regarding the "add_transform_xyz_rpy" , it was typo mistake. The api now publishes the correctly. Another question, do you have any suggestion for merging 2 laser scanners? For some reason ira laser tools is not working with the sick scanners - pico100.