stereolabs / zed-ros2-wrapper

ROS 2 wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros2/
Apache License 2.0
136 stars 141 forks source link

Robot State Publisher Error #76

Closed THLL245 closed 2 years ago

THLL245 commented 2 years ago

Preliminary Checks

Description

Worked fine before hand, but after update & upgrade started to get a robot state publisher error when only launching the zed wrapper. Cant figure out how its related.

> tyler@tyler:~/ros_ws$ ros2 launch zed_wrapper zed2i.launch.py
[INFO] [launch]: All log files can be found below /home/tyler/.ros/log/2022-02-12-15-19-39-065977-tyler-28816
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name=‘Task-2’ coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=TypeError(“Allowed value types are bytes, bool, int, float, str, Sequence[bool], Sequence[int], Sequence[float], Sequence[str]. Got <class ‘NoneType’>.If the parameter is meant to be a string, try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)”)>
Traceback (most recent call last):
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 228, in _process_one_event
await self.__process_event(next_event)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
[Previous line repeated 3 more times]
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py”, line 108, in visit
return self.execute(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 444, in execute
self._perform_substitutions(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py”, line 399, in _perform_substitutions
evaluated_parameters = evaluate_parameters(context, self.__parameters)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py”, line 160, in evaluate_parameters
output_params.append(evaluate_parameter_dict(context, param))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py”, line 95, in evaluate_parameter_dict
raise TypeError(
TypeError: Allowed value types are bytes, bool, int, float, str, Sequence[bool], Sequence[int], Sequence[float], Sequence[str]. Got <class ‘NoneType’>.If the parameter is meant to be a string, try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)
Task exception was never retrieved
future: <Task finished name=‘Task-8’ coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=RuntimeError(‘Signal event received before subprocess transport available.’)>
Traceback (most recent call last):
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 228, in _process_one_event
await self.__process_event(next_event)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py”, line 248, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py”, line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py”, line 108, in visit
return self.execute(context)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/opaque_function.py”, line 75, in execute
return self.__function(context, *self.__args, **self.__kwargs)
File “/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py”, line 443, in __on_signal_process_event
raise RuntimeError(‘Signal event received before subprocess transport available.’)
RuntimeError: Signal event received before subprocess transport available.
[INFO] [robot_state_publisher-1]: process started with pid [28819]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link zed2i_base_link had 1 children
[robot_state_publisher-1] Link zed2i_camera_center had 2 children
[robot_state_publisher-1] Link zed2i_left_camera_frame had 1 children
[robot_state_publisher-1] Link zed2i_left_camera_optical_frame had 0 children
[robot_state_publisher-1] Link zed2i_right_camera_frame had 1 children
[robot_state_publisher-1] Link zed2i_right_camera_optical_frame had 0 children
[robot_state_publisher-1] 1644707979.529803626 [zed2i.zed_state_publisher] [INFO] got segment base_link
[robot_state_publisher-1] 1644707979.529967897 [zed2i.zed_state_publisher] [INFO] got segment zed2i_base_link
[robot_state_publisher-1] 1644707979.529997436 [zed2i.zed_state_publisher] [INFO] got segment zed2i_camera_center
[robot_state_publisher-1] 1644707979.530038623 [zed2i.zed_state_publisher] [INFO] got segment zed2i_left_camera_frame
[robot_state_publisher-1] 1644707979.530064930 [zed2i.zed_state_publisher] [INFO] got segment zed2i_left_camera_optical_frame
[robot_state_publisher-1] 1644707979.530105125 [zed2i.zed_state_publisher] [INFO] got segment zed2i_right_camera_frame
[robot_state_publisher-1] 1644707979.530147145 [zed2i.zed_state_publisher] [INFO] got segment zed2i_right_camera_optical_frame
[ERROR] [robot_state_publisher-1]: process[robot_state_publisher-1] failed to terminate ‘5’ seconds after receiving ‘SIGINT’, escalating to ‘SIGTERM’
[INFO] [robot_state_publisher-1]: sending signal ‘SIGTERM’ to process[robot_state_publisher-1]
[ERROR] [robot_state_publisher-1]: process has died [pid 28819, exit code -15, cmd ‘/opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher --ros-args -r __node:=zed_state_publisher -r __ns:=/zed2i --params-file /tmp/launch_params_5pmiec_h’].

Reinstalled ROS2 (Foxy), Reinstalled ZED SDK 3.6, Reinstalled ZED wrapper (colcon build no errors), verified robot state publisher works (launched urdf separately).

At least point I am about to reinstall the whole OS because that was the only change before this stopped working

Steps to Reproduce

  1. Update to latest OS (20.04)
  2. Run wrapper
  3. ...

Expected Result

Publish topics

Actual Result

Failed with robot state publisher error

ZED Camera model

ZED2i

Environment

Jetson Xavier (Jetpack 4.5)
Ubuntu 20.04
ZED SDK 3.6
ROS2 Foxy

Anything else?

Thought this was related to the URDF but when I change the launch file "Publish URDF" = 'false' I get the following error

> tyler@tyler:~/ros_ws$ ros2 launch zed_display_rviz2 display_zed2i.launch.py
[INFO] [launch]: All log files can be found below /home/tyler/.ros/log/2022-02-13-08-43-43-744439-tyler-21904
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=TypeError("Allowed value types are bytes, bool, int, float, str, Sequence[bool], Sequence[int], Sequence[float], Sequence[str]. Got <class 'NoneType'>.If the parameter is meant to be a string, try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)")>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 3 more times]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 444, in execute
    self._perform_substitutions(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 399, in _perform_substitutions
    evaluated_parameters = evaluate_parameters(context, self.__parameters)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 160, in evaluate_parameters
    output_params.append(evaluate_parameter_dict(context, param))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 95, in evaluate_parameter_dict
    raise TypeError(
TypeError: Allowed value types are bytes, bool, int, float, str, Sequence[bool], Sequence[int], Sequence[float], Sequence[str]. Got <class 'NoneType'>.If the parameter is meant to be a string, try wrapping it in launch_ros.parameter_descriptions.ParameterValue(value, value_type=str)
THLL245 commented 2 years ago

Adding that the camera works fine when using ZED_Explorer

Myzhar commented 2 years ago

If you are using the ZED SDK v3.6.4 or minor, then you must upgrade to v3.6.5 because the latest Ubuntu upgrade broke the connection between the ZED SDK. ZED SDK v3.6.5 fixes the issue. Before recompiling clean the cache of your ROS2 workspace

THLL245 commented 2 years ago

Currently on v3.6.5, reinstalled it too, cleared cache, reinstalled wrapper, cleared cache again. When building got the following errors but I believe are just warnings

`-- stderr: zed_wrapper                                                                           
In file included from /home/tyler/ros_ws/install/zed_components/include/zed_components/sl_tools.h:50,
                 from /home/tyler/ros_ws/install/zed_components/include/zed_components/zed_camera_component.hpp:29,
                 from /home/tyler/ros_ws/src/zed-ros2-wrapper/zed_wrapper/src/zed_wrapper.cpp:26:
/usr/local/zed/include/sl/Camera.hpp:784:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
  784 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:937:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
  937 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1114:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1114 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1278:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1278 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1282:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1282 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1286:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1286 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1526:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1526 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1530:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1530 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp:1534:13: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
 1534 |             };
      |             ^
/usr/local/zed/include/sl/Camera.hpp: In function ‘sl::Timestamp sl::operator+(sl::Timestamp, const sl::Timestamp&)’:
/usr/local/zed/include/sl/Camera.hpp:1992:16: warning: implicitly-declared ‘constexpr sl::Timestamp::Timestamp(const sl::Timestamp&)’ is deprecated [-Wdeprecated-copy]
 1992 |         return lhs;
      |                ^~~
/usr/local/zed/include/sl/Camera.hpp:1931:20: note: because ‘sl::Timestamp’ has user-provided ‘sl::Timestamp& sl::Timestamp::operator=(sl::Timestamp)’
 1931 |         Timestamp& operator=(Timestamp other) {
      |                    ^~~~~~~~
/usr/local/zed/include/sl/Camera.hpp: In function ‘sl::Timestamp sl::operator-(sl::Timestamp, const sl::Timestamp&)’:
/usr/local/zed/include/sl/Camera.hpp:1997:16: warning: implicitly-declared ‘constexpr sl::Timestamp::Timestamp(const sl::Timestamp&)’ is deprecated [-Wdeprecated-copy]
 1997 |         return lhs;
      |                ^~~
/usr/local/zed/include/sl/Camera.hpp:1931:20: note: because ‘sl::Timestamp’ has user-provided ‘sl::Timestamp& sl::Timestamp::operator=(sl::Timestamp)’
 1931 |         Timestamp& operator=(Timestamp other) {
      |                    ^~~~~~~~
/usr/local/zed/include/sl/Camera.hpp: In function ‘sl::Timestamp sl::operator/(sl::Timestamp, const sl::Timestamp&)’:
/usr/local/zed/include/sl/Camera.hpp:2002:16: warning: implicitly-declared ‘constexpr sl::Timestamp::Timestamp(const sl::Timestamp&)’ is deprecated [-Wdeprecated-copy]
 2002 |         return lhs;
      |                ^~~
/usr/local/zed/include/sl/Camera.hpp:1931:20: note: because ‘sl::Timestamp’ has user-provided ‘sl::Timestamp& sl::Timestamp::operator=(sl::Timestamp)’
 1931 |         Timestamp& operator=(Timestamp other) {
      |                    ^~~~~~~~
/usr/local/zed/include/sl/Camera.hpp: In function ‘sl::Timestamp sl::operator*(sl::Timestamp, const sl::Timestamp&)’:
/usr/local/zed/include/sl/Camera.hpp:2007:16: warning: implicitly-declared ‘constexpr sl::Timestamp::Timestamp(const sl::Timestamp&)’ is deprecated [-Wdeprecated-copy]
 2007 |         return lhs;
      |                ^~~
/usr/local/zed/include/sl/Camera.hpp:1931:20: note: because ‘sl::Timestamp’ has user-provided ‘sl::Timestamp& sl::Timestamp::operator=(sl::Timestamp)’
 1931 |         Timestamp& operator=(Timestamp other) {
      |                    ^~~~~~~~
/usr/local/zed/include/sl/Camera.hpp: In function ‘sl::Timestamp sl::getCurrentTimeStamp()’:
/usr/local/zed/include/sl/Camera.hpp:2041:16: warning: implicitly-declared ‘constexpr sl::Timestamp::Timestamp(const sl::Timestamp&)’ is deprecated [-Wdeprecated-copy]
 2041 |         return current_ts;
      |                ^~~~~~~~~~
/usr/local/zed/include/sl/Camera.hpp:1931:20: note: because ‘sl::Timestamp’ has user-provided ‘sl::Timestamp& sl::Timestamp::operator=(sl::Timestamp)’
 1931 |         Timestamp& operator=(Timestamp other) {
      |                    ^~~~~~~~
/usr/local/zed/include/sl/Camera.hpp: In function ‘cudaError sl::__cudaSafeCall(cudaError, const char*, const char*, int)’:
/usr/local/zed/include/sl/Camera.hpp:2048:89: warning: unused parameter ‘file’ [-Wunused-parameter]
 2048 | tic inline cudaError __cudaSafeCall(cudaError err, const char *func, const char *file, const int line) {
      |                                                                      ~~~~~~~~~~~~^~~~

/usr/local/zed/include/sl/Camera.hpp:2048:105: warning: unused parameter ‘line’ [-Wunused-parameter]
 2048 | rror __cudaSafeCall(cudaError err, const char *func, const char *file, const int line) {
      |                                                                        ~~~~~~~~~~^~~~

In file included from /home/tyler/ros_ws/install/zed_components/include/zed_components/sl_tools.h:50,
                 from /home/tyler/ros_ws/install/zed_components/include/zed_components/zed_camera_component.hpp:29,
                 from /home/tyler/ros_ws/src/zed-ros2-wrapper/zed_wrapper/src/zed_wrapper.cpp:26:
/usr/local/zed/include/sl/Camera.hpp: At global scope:
/usr/local/zed/include/sl/Camera.hpp:5345:12: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
 5345 |     inline const void /*@cond SHOWHIDDEN*/SL_SDK_EXPORT/*@endcond*/ getZEDSDKBuildVersion(int &major, int& minor, int& patch) {
      |            ^~~~~
In file included from /home/tyler/ros_ws/install/zed_components/include/zed_components/sl_tools.h:50,
                 from /home/tyler/ros_ws/install/zed_components/include/zed_components/zed_camera_component.hpp:29,
                 from /home/tyler/ros_ws/src/zed-ros2-wrapper/zed_wrapper/src/zed_wrapper.cpp:26:
/usr/local/zed/include/sl/Camera.hpp:5734:2: warning: extra ‘;’ [-Wpedantic]
 5734 | };
      |  ^
---

Same error

Myzhar commented 2 years ago

I just noticed that you have Ubuntu 20.04 on Xavier. Are you using Docker or did you upgrade Ubuntu 18.04 to 20.04? The Nvidia Jetson boards do not support Ubuntu 20.04 yet, you should not upgrade the OS via apt

THLL245 commented 2 years ago

I upgraded to 20.04 via apt but had no issues with it. Everything I need to run on the Jetson works well. Zed wrapper ran great for weeks now. Only change was a upgrade yesterday now getting this error. I'll see if I can revert back and try the wrapper again

Myzhar commented 2 years ago

Fixed with a patch in https://github.com/stereolabs/zed-ros2-wrapper/commit/6cd5affeaef51eab8f7beb708c73ff95e2adf6f3 See also #75

@THLL245 let me know if this solved the problem for you then close the issue if ok.

THLL245 commented 2 years ago

It works again thank you!