ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Ouster Driver for ROS2

asked 2022-02-08 15:11:08 -0500

Barty gravatar image

I'm attempting to use the ROS2 Ouster driver on Foxy and Ubuntu 20.04 and having problems.

I am connecting to an OS1 LiDAR with firmware version v2.2.0. I can connect to it on the config page at the os-XXXXX.local address as well as though the OusterStudio application.

When following the instructions at https://github.com/ros-drivers/ros2_o... under the Component heading I get the following:

milner@canterbury:~$ source /opt/ros/foxy/setup.bash
milner@canterbury:~$ cd code/ros2_workspace/
milner@canterbury:~/code/ros2_workspace$ ros2 component load /ComponentManager ros2_ouster ros2_ouster::OS1Driver
Loaded component 1 into '/ComponentManager' container node as '/OusterDriver'
milner@canterbury:~/code/ros2_workspace$ ros2 param set OusterDriver lidar_ip os-992129000537.local
Set parameter successful
milner@canterbury:~/code/ros2_workspace$ ros2 param set OusterDriver computer_ip 169.254.32.56
Set parameter successful
milner@canterbury:~/code/ros2_workspace$ ros2 lifecycle set OusterDriver 1
Transitioning failed
milner@canterbury:~/code/ros2_workspace$ ros2 lifecycle set OusterDriver 3
Unknown transition requested, available ones are:
- configure [1]
- shutdown [5]

And over in my other terminal I get:

milner@canterbury:~/code/ros2_workspace$ ros2 run rclcpp_components component_container
[INFO] [1644353685.156037464] [ComponentManager]: Load Library: /opt/ros/foxy/lib/libouster_driver_core.so
[INFO] [1644353685.162147508] [ComponentManager]: Found class: rclcpp_components::NodeFactoryTemplate<ros2_ouster::OS1Driver>
[INFO] [1644353685.162162592] [ComponentManager]: Instantiate class: rclcpp_components::NodeFactoryTemplate<ros2_ouster::OS1Driver>
[INFO] [1644353769.738136712] [OusterDriver]: Configuring Ouster driver node.
[INFO] [1644353769.738229749] [OusterDriver]: Connecting to sensor at os-992129000537.local.
[INFO] [1644353769.738239176] [OusterDriver]: Broadcasting data from sensor to 169.254.32.56.
[ERROR] [1644353769.769268933] []: Caught exception in callback for transition 10
[ERROR] [1644353769.769292744] []: Original error: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
[WARN] [1644353769.769328709] []: Error occurred while doing error handling.
[ERROR] [1644353769.769338368] [OusterDriver]: Handing error in Ouster driver node.
[INFO] [1644353785.799961202] [OusterDriver]: Shutting down Ouster driver node.

If, instead, I try to run the default launch script, after modifying the params file I get:

milner@canterbury:~/code/ros2_workspace$ ros2 launch ros2_ouster os1_launch.py 
[INFO] [launch]: All log files can be found below /home/milner/.ros/log/2022-02-08-13-09-02-533595-canterbury-45739
[INFO] [launch]: Default logging verbosity is set to INFO
/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/lifecycle_node.py:84: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead
  warnings.warn("The parameter 'node_name' is deprecated, use 'name' instead")
/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/lifecycle_node.py:95: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead
  super().__init__(name=name, namespace=namespace, **kwargs)
/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py:196: UserWarning: The parameter 'node_namespace' is deprecated, use 'namespace' instead
  warnings.warn("The parameter 'node_namespace' is deprecated, use 'namespace' instead")
[INFO] [ouster_driver-1]: process started with pid [45751]
[ouster_driver-1] [INFO] [1644354542.883533387] [ouster_driver]: Configuring Ouster driver node.
[ouster_driver-1] [INFO] [1644354542.883904337] [ouster_driver]: Connecting to sensor at os-992129000537.local.
[ouster_driver-1] [INFO] [1644354542.883955140] [ouster_driver]: Broadcasting data from sensor to 169.254.32.56.
[ouster_driver-1] [ERROR] [1644354543.040435627] []: Caught exception in callback for transition 10
[ouster_driver-1] [ERROR] [1644354543.040504266] []: Original error: vector::_M_range_check: __n (which is 0) >= this->size() (which ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-08 16:23:46 -0500

Mackou gravatar image

updated 2022-02-08 16:26:29 -0500

You actually do not need to use component command at all to launch the driver. Set the configuration and run the launchfile.

Here's what you should try :

  • Make sure you can ping your sensor.
  • Download the config file here, edit it according to your needs and save it somewhere.
    • lidar_ip is the address of your sensor
    • computer_ip is the address of the computer running the driver, in the network your sensor is connected.
  • Run the node with roslaunch :

    ros2 launch ros2_ouster driver_launch.py params_file:=[PATH_TO_YOUR_CONFIG_FILE]

edit flag offensive delete link more

Comments

Thanks! That certainly makes launching it easier, but I'm still getting the exception error.

[ouster_driver-1] [ERROR] [1644366799.185983906] []: Caught exception in callback for transition 10
[ouster_driver-1] [ERROR] [1644366799.186041723] []: Original error: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
[ouster_driver-1] [WARN] [1644366799.186108123] []: Error occurred while doing error handling.
[ouster_driver-1] [ERROR] [1644366799.186136116] [ouster_driver]: Handing error in Ouster driver node.
[ERROR] [launch_ros.actions.lifecycle_node]: Failed to make transition 'TRANSITION_CONFIGURE' for LifecycleNode '/ouster_driver'

One thing I noticed is that you are calling driver_launch.py while my ouster_driver directory has os1_launch.py. Is there a version issue here?

Barty gravatar image Barty  ( 2022-02-08 18:35:56 -0500 )edit

Can you give the complete log ? Also how did you download/install the driver ? How do you lunch it ?

Mackou gravatar image Mackou  ( 2022-02-09 01:25:57 -0500 )edit

Sure, I installed it as part of the foxy packages for ubuntu following the guide at https://docs.ros.org/en/foxy/Installa... so sudo apt install -y ros-foxy-ros2-ouster along with a bunch of other packages.

The log is too long to fit in a single comment, so I'll split it in two below.

Thanks!

Barty gravatar image Barty  ( 2022-02-09 15:26:26 -0500 )edit

milner@canterbury:~/code/ros2_workspace$ ros2 launch ros2_ouster os1_launch.py params_file:=./config/params/ouster_config.yaml /opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/lifecycle_node.py:84: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead warnings.warn("The parameter 'node_name' is deprecated, use 'name' instead") /opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/lifecycle_node.py:95: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead uper().__init__(name=name, namespace=namespace, **kwargs)

Barty gravatar image Barty  ( 2022-02-09 15:27:46 -0500 )edit

/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py:196: UserWarning: The parameter 'node_namespace' is deprecated, use 'namespace' instead warnings.warn("The parameter 'node_namespace' is deprecated, use 'namespace' instead") [INFO] [ouster_driver-1]: process started with pid [131196] [ouster_driver-1] [INFO] [1644441692.853956019] [ouster_driver]: Configuring Ouster driver node. [ouster_driver-1] [INFO] [1644441692.854293442] [ouster_driver]: Connecting to sensor at os-992129000537.local. [ouster_driver-1] [INFO] [1644441692.854348808] [ouster_driver]: Broadcasting data from sensor to 169.254.32.56.

Barty gravatar image Barty  ( 2022-02-09 15:28:37 -0500 )edit
[ERROR] [launch_ros.actions.lifecycle_node]: Failed to make transition 'TRANSITION_CONFIGURE' for LifecycleNode '/ouster_driver'
[ouster_driver-1] [ERROR] [1644441693.127040147] []: Original error: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
[ouster_driver-1] [WARN] [1644441693.127125173] []: Error occurred while doing error handling.
[ouster_driver-1] [ERROR] [1644441693.127156314] [ouster_driver]: Handing error in Ouster driver node.
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[INFO] [launch.user]: [LifecycleLaunch] Ouster driver node is exiting.
[ouster_driver-1] [INFO] [1644441699.535128074] [rclcpp]: signal_handler(signal_value=2)
[INFO] [ouster_driver-1]: process has finished cleanly [pid 131196]
Barty gravatar image Barty  ( 2022-02-09 15:28:57 -0500 )edit
1

Still, not much info from that log... Can you get to build it from source ? If not I would post an issue directly on GitHub. With a description of your problem, the sensor model and the complete log. Use the branch "ros2" I will answer from there . Please post the link to the issue here as well

Mackou gravatar image Mackou  ( 2022-02-09 15:48:38 -0500 )edit

Ah! Building from the current head seems to have fixed it. Thanks! One question though, after starting the driver with ros2 launch ros2_ouster driver_launch.py params_file:=../ros2_workspace/config/params/ouster_config.yaml I'm not seeing anything in ros2 topic list. In fact, that command just hangs. Is there something else I need to launch?

Barty gravatar image Barty  ( 2022-02-09 18:08:56 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-08 15:11:08 -0500

Seen: 1,744 times

Last updated: Feb 08 '22