[iRobot Create 3] Slamtec S2 Lidar Error

Hello. I recently bought from you 2 sets including 2 Create3, 2 Slamtec S2 Lidars and 2 Oak-D Pro.
I have the same problem on both robots.

I start ros2 launch create3_lidar_slam sensors_launch.py:

[INFO] [launch]: All log files can be found below /home/ccordero/.ros/log/2024-06-16-10-58-35-788301-sr2-pi-4078 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [static_transform_publisher-1]: process started with pid [4079] [static_transform_publisher-1] [WARN] [1718528316.082610138] []: Old-style arguments are deprecated; see --help for new-style arguments [static_transform_publisher-1] [INFO] [1718528316.131057221] [static_transform_publisher_2IUKlNQnpDZhYiXa]: Spinning until stopped - publishing transform [static_transform_publisher-1] translation: ('-0.012000', '0.000000', '0.144000') [static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000') [static_transform_publisher-1] from 'base_footprint' to 'laser_frame' [INFO] [rplidar_composition-2]: process started with pid [4090] [rplidar_composition-2] [INFO] [1718528318.143819291] [rplidar_node]: RPLidar running on ROS2 package rplidar_ros. RPLIDAR SDK Version:2.0.0 [rplidar_composition-2] [INFO] [1718528318.197315042] [rplidar_node]: RPLidar S/N: AAD7ECF8C4E699D7B8EB99F926084717 [rplidar_composition-2] [INFO] [1718528318.197548317] [rplidar_node]: Firmware Ver: 1.01 [rplidar_composition-2] [INFO] [1718528318.197629076] [rplidar_node]: Hardware Rev: 18 [rplidar_composition-2] [INFO] [1718528318.249050535] [rplidar_node]: RPLidar health status : 0 [rplidar_composition-2] [INFO] [1718528318.249217181] [rplidar_node]: RPLidar health status : OK. [rplidar_composition-2] [INFO] [1718528320.262113083] [rplidar_node]: Start [rplidar_composition-2] [INFO] [1718528320.954570804] [rplidar_node]: current scan mode: DenseBoost, sample rate: 32 Khz, max_distance: 30.0 m, scan frequency:10.0 Hz,
After running the bot for a couple of minutes, it stops sending to /scan.
I then kill the process and restart with the same command: ros2 launch create3_lidar_slam sensors_launch.py

[INFO] [launch]: All log files can be found below /home/ccordero/.ros/log/2024-06-16-11-01-27-413092-sr2-pi-4113 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [static_transform_publisher-1]: process started with pid [4114] [static_transform_publisher-1] [WARN] [1718528487.724203140] []: Old-style arguments are deprecated; see --help for new-style arguments [static_transform_publisher-1] [INFO] [1718528487.772116859] [static_transform_publisher_Dtu94dUVOSSsyX2S]: Spinning until stopped - publishing transform [static_transform_publisher-1] translation: ('-0.012000', '0.000000', '0.144000') [static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000') [static_transform_publisher-1] from 'base_footprint' to 'laser_frame' [INFO] [rplidar_composition-2]: process started with pid [4125] [rplidar_composition-2] [INFO] [1718528489.776632797] [rplidar_node]: RPLidar running on ROS2 package rplidar_ros. RPLIDAR SDK Version:2.0.0 [rplidar_composition-2] [INFO] [1718528489.827139821] [rplidar_node]: RPLidar S/N: AAD7ECF8C4E699D7B8EB99F926084717 [rplidar_composition-2] [INFO] [1718528489.827303504] [rplidar_node]: Firmware Ver: 1.01 [rplidar_composition-2] [INFO] [1718528489.827381133] [rplidar_node]: Hardware Rev: 18 [rplidar_composition-2] [INFO] [1718528489.878809036] [rplidar_node]: RPLidar health status : 2 [rplidar_composition-2] [ERROR] [1718528489.879004478] [rplidar_node]: Error, RPLidar internal error detected. Please reboot the device to retry. [ERROR] [rplidar_composition-2]: process has died [pid 4125, exit code 255, cmd '/opt/ros/humble/lib/rplidar_ros/rplidar_composition --ros-args -r __ns:=/ --params-file /home/ccordero/create3_examples_ws/install/create3_lidar_slam/share/create3_lidar_slam/config/rplidar_node.yaml'].

The only way to recover from there is unplug both usb cables and plug them again.
I have tested both S2 lidars. Same issue.

Would you please let me know how I can fix this behaviour?
Thank you in advance.
Regards. Carlos

Dear @ccordero,

Please provide the following information for further assistance:

Robot ID

Robot type: e.g. Unitree GO2

Robot Hardware

OS: e.g. Ubuntu 20.04
ROS Distro: e.g. ROS2 Foxy
Built from source or installed: e.g. Installed
Package/SDK version: e.g. Package from MYBOTSHOP
Real hardware or simulation: e.g. Hardware

Expected behavior

A clear and concise description of what you expected to happen.

Actual behavior

A clear and concise description of what you encountered.

To Reproduce

Provide the steps to reproduce:

  • e.g run something
  • e.g launch something else
  • e.g see the error
  • e.g Other notes

Add anything else you think is important.

Also, does this issue occur when both lidars are running in the same time. It seems to be the case that since no topics are subscribing to the Lidar, it is powering off to conserve power. Have you tried ensuring that there is some subscriber and if the behaviors continues?

[quote=“Sohail, post:2, topic:966”]

Robot ID

Robot type: iRobot Create3

Robot Hardware

OS: Ubuntu 22.04
ROS Distro: ROS2 Humble
Built from source or installed: Installed
Package/SDK version: Package from iRobotEducation/Create3
Real hardware or simulation: Hardware

Expected behavior

I expect create3_lidar_slam program to receive lidar data to build correctly the map until the robot is docked again

Actual behavior

After a few minutes - after undocking - of running create3_lidar_slam on the RPi4 on iRobot Create3 and create_lidar_slam rviz on the pc, the program stop receiving lidar data. Restarting create3_lidar_slam shows: Error, RPLidar internal error detected. Please reboot the device to retry. and no lidar data is received anymore.

To Reproduce

Provide the steps to reproduce:

Start on rPi4 in different terminals:
ros2 launch create3_lidar_slam sensors_launch.py
ros2 launch create3_lidar_slam slam_toolbox_launch.py
ros2 launch teleop_twist_joy teleop-launch.py joy_config:=‘xbox’

Start on PC:
ros2 launch create3_lidar_slam rviz_launch.py

Thank you. Have a great day.
Carlos

Apologies for the confusion: only ONE lidar is connected to each iRobot Create3 (Ibought 2 Creat3, 2 Slamtec S2 and 2 OAK-D-Pro).

Have you checked that on bootup if the lidar drivers are automatically starting up. Unlike in ROS1 if you create a duplicate node, it does not kill the first node. On fresh start please provide a screenshot of the ros2 node list as well as a screenshot of the sudo service (press tab tab twice to list all the services). Also please share the configurations of the lidar slam as well as the launch file.

On a final note have you updated to the latest drivers for the robot?

Hello.
Create 3 robots have been updated to latest Humble firmware (H.2.6).
ros2 node list after a pi4 reboot+create3 reboot:

/battery_state
/cliff_intensity
/cmd_audio
/cmd_lightring
/cmd_vel
/dock_status
/interface_buttons
/ir_intensity
/ir_opcode
/kidnap_status
/mobility_monitor/transition_event
/odom
/parameter_events
/robot_state/transition_event
/rosout
/slip_status
/static_transform/transition_event
/stop_status
/tf
/tf_static

service:

apparmor ModemManager systemd-ask-password-wall
apport modprobe@configfs systemd-binfmt
apport-autoreport modprobe@drm systemd-boot-system-token
apt-daily modprobe@efi_pstore systemd-fsckd
apt-daily-upgrade modprobe@fuse systemd-fsck@dev-disk-by\x2dlabel-system\x2dboot
avahi-daemon motd-news systemd-fsck-root
blk-availability multipathd systemd-initctl
bluetooth netplan-ovs-cleanup systemd-journald
bthelper@hci0 netplan-wpa-wlan0 systemd-journal-flush
chrony networkd-dispatcher systemd-logind
cloud-config NetworkManager systemd-machine-id-commit
cloud-final NetworkManager-wait-online systemd-modules-load
cloud-init open-iscsi systemd-networkd
cloud-init-hotplugd open-vm-tools systemd-networkd-wait-online
cloud-init-local plymouth systemd-pstore
console-setup plymouth-log systemd-quotacheck
console-setup.sh plymouth-quit systemd-random-seed
cron plymouth-quit-wait systemd-remount-fs
cryptdisks plymouth-read-write systemd-resolved
cryptdisks-early plymouth-start systemd-rfkill
dbus polkit systemd-sysctl
discovery pollinate systemd-sysusers
dmesg procps systemd-tmpfiles-clean
dm-event rc-local systemd-tmpfiles-setup
dpkg-db-backup rescue systemd-tmpfiles-setup-dev
e2scrub_all rpi-eeprom-update systemd-udevd
e2scrub_reap rsync systemd-udev-trigger
emergency rsyslog systemd-update-utmp
finalrd screen-cleanup systemd-update-utmp-runlevel
fstrim secureboot-db systemd-user-sessions
getty-static serial-getty@ttyS0 ua-reboot-cmds
getty@tty1 setvtrgb ua-timer
hciuart snapd ubuntu-advantage
hwclock.sh snapd.apparmor udev
irqbalance snapd.autoimport ufw
iscsid snapd.core-fixup unattended-upgrades
keyboard-setup snapd.failure update-notifier-download
keyboard-setup.sh snapd.recovery-chooser-trigger update-notifier-motd
kmod snapd.seeded user@1000
kmod-static-nodes snapd.snap-repair user-runtime-dir@1000
logrotate snap.lxd.activate uuidd
lvm2 snap.lxd.daemon vgauth
lvm2-lvmpolld snap.lxd.user-daemon wpa_supplicant
lvm2-monitor ssh x11-common
lxd-agent systemd-ask-password-console
man-db systemd-ask-password-plymouth

lidar slam config and launch file come from create3_examples/create3_lidar_slam:

/**:
rplidar_node:
ros__parameters:
angle_compensate: true
channel_type: serial
flip_x_axis: false
frame_id: laser_frame
inverted: false
scan_mode: ‘’
serial_baudrate: 115200
serial_port: /dev/ttyUSB0
topic_name: scan
use_sim_time: false

  # True turns off lidar motor when scan topic is not subscribed to. 
  # False runs lidar motor constantly. 
  auto_standby: true

#!/usr/bin/env python3

Copyright 2022 iRobot Corporation. All Rights Reserved.

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument, TimerAction
from launch.substitutions import LaunchConfiguration
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
# Evaluate at launch the value of the launch configuration ‘namespace’
namespace = LaunchConfiguration(‘namespace’)

# Declares an action to allow users to pass the robot namespace from the
# CLI into the launch description as an argument.
namespace_argument = DeclareLaunchArgument(
    'namespace',
    default_value='',
    description='Robot namespace')

# Declares an action that will launch a node when executed by the launch description.
# This node is responsible for providing a static transform from the robot's base_footprint
# frame to a new laser_frame, which will be the coordinate frame for the lidar.
static_transform_node = Node(
    package='tf2_ros',
    executable='static_transform_publisher',
    arguments=['-0.012', '0', '0.144', '0', '0', '0', 'base_footprint', 'laser_frame'],

    # Remaps topics used by the 'tf2_ros' package from absolute (with slash) to relative (no slash).
    # This is necessary to use namespaces with 'tf2_ros'.
    remappings=[
        ('/tf_static', 'tf_static'),
        ('/tf', 'tf')],
    namespace=namespace
)

# Declares an action that will launch a node when executed by the launch description.
# This node is responsible for configuring the RPLidar sensor.
rplidar_node = Node(
    package='rplidar_ros',
    executable='rplidar_composition',
    output='screen',
    parameters=[
        get_package_share_directory("create3_lidar_slam") + '/config/rplidar_node.yaml'
        ],
    namespace=namespace
)

# Launches all named actions
return LaunchDescription([
    namespace_argument,
    static_transform_node,
    TimerAction(
        period=2.0,
        actions=[rplidar_node]
    )
])

#!/usr/bin/env python3

Copyright 2022 iRobot Corporation. All Rights Reserved.

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory

def generate_launch_description():
# Evaluate at launch the value of the launch configuration ‘use_sim_time’
use_sim_time = LaunchConfiguration(‘use_sim_time’)

# Declares an action to allow users to pass the sim time from the 
# CLI into the launch description as an argument.
declare_use_sim_time_argument = DeclareLaunchArgument(
    'use_sim_time',
    default_value='false',
    description='Use simulation/Gazebo clock')

# Evaluate at launch the value of the launch configuration 'namespace' 
namespace = LaunchConfiguration('namespace')

# Declares an action to allow users to pass the robot namespace from the 
# CLI into the launch description as an argument.
namespace_argument = DeclareLaunchArgument(
    'namespace', 
    default_value='',
    description='Robot namespace')

# Declares an action that will launch a node when executed by the launch description.
# This node is responsible for configuring and running slam toolbox.  
start_async_slam_toolbox_node = Node(
    parameters=[
      get_package_share_directory("create3_lidar_slam") + '/config/mapper_params_online_async.yaml',
      {'use_sim_time': use_sim_time}
    ],
    package='slam_toolbox',
    executable='async_slam_toolbox_node',
    name='slam_toolbox',
    output='screen',
    namespace=namespace,
    # Remaps topics used by the 'slam_toolbox' package from absolute (with slash) to relative (no slash).
    # This is necessary to use namespaces with 'slam_toolbox'.
    remappings = [
    ('/tf', 'tf'),
    ('/tf_static', 'tf_static'),
    ('/scan', 'scan'),
    ('/map', 'map'),
    ('/map_metadata', 'map_metadata')
])

ld = LaunchDescription()

ld.add_action(declare_use_sim_time_argument)
ld.add_action(namespace_argument)
ld.add_action(start_async_slam_toolbox_node)

# Launches all named actions
return ld

Thank you.

Please set this to false.

Good day Salman.
This has fixed the status error 2.
Thank you for the reply. I did the change after reading your msg 2 days ago, and left running the lidar_slam for many hours, some of them moving the robot around. Status error did not show up during this time.
May I kindly request why this change fixed the problem? lidar_slam was running at the time this error showed up, hence there were at least one program subscribed to the /scan topic.
Thank you again for your time and support. Have a great week ahead. C.

1 Like

Dear @ccordero,

If there was a subscription available it should not turn off.

I suspect one of two things:

  1. Its a bug
  2. The DDS communication did not connect the node of subscription and the lidar node.

Glad to hear that.