NITROS error: no type named ‘BaseType’ in ‘struct nvidia::isaac_ros::nitros::NitrosCameraInfo’

Hello,

I’ve been trying to convert some Isaac ROS packages to lifecycle nodes, and I want to use the Nitros camera info messages instead of ROS messages in the nitros_image_switch_node. However, I’m getting this error when I switch the declaration type of sub_camera_info_ from message_filters::Subscriber<sensor_msgs::msg::CameraInfo> to nvidia::isaac_ros::nitros::message_filters::Subscriber<nvidia::isaac_ros::nitros::NitrosCameraInfo> in nitros_image_switch_node.hpp.

Here’s the error in detail:

In file included from /workspaces/ros-ws/src/utilities/isaac_ros_nitros/isaac_ros_managed_nitros_examples/custom_nitros_message_filter/include/custom_nitros_message_filter/synchronizer_node.hpp:30,
                 from /workspaces/ros-ws/src/utilities/isaac_ros_nitros/isaac_ros_managed_nitros_examples/custom_nitros_message_filter/src/synchronizer_node.cpp:18:
/workspaces/ros-ws/install/share/isaac_ros_managed_nitros/gxf/include/isaac_ros_managed_nitros/managed_nitros_message_filters_subscriber.hpp: In instantiation of ‘class nvidia::isaac_ros::nitros::message_filters::Subscriber<nvidia::isaac_ros::nitros::NitrosCameraInfo>’:
/workspaces/ros-ws/src/utilities/isaac_ros_nitros/isaac_ros_managed_nitros_examples/custom_nitros_message_filter/include/custom_nitros_message_filter/synchronizer_node.hpp:58:3:   required from here
/workspaces/ros-ws/install/share/isaac_ros_managed_nitros/gxf/include/isaac_ros_managed_nitros/managed_nitros_message_filters_subscriber.hpp:39:7: error: no type named ‘BaseType’ in ‘struct nvidia::isaac_ros::nitros::NitrosCameraInfo’
   39 | class Subscriber
      |       ^~~~~~~~~~
/workspaces/ros-ws/install/share/isaac_ros_managed_nitros/gxf/include/isaac_ros_managed_nitros/managed_nitros_message_filters_subscriber.hpp:45:46: error: no type named ‘BaseType’ in ‘struct nvidia::isaac_ros::nitros::NitrosCameraInfo’
   45 |   typedef typename NitrosTypeViewT::BaseType MessageType;
      |                                              ^~~~~~~~~~~
/workspaces/ros-ws/install/share/isaac_ros_managed_nitros/gxf/include/isaac_ros_managed_nitros/managed_nitros_message_filters_subscriber.hpp:46:62: error: no type named ‘BaseType’ in ‘struct nvidia::isaac_ros::nitros::NitrosCameraInfo’
   46 |   typedef ::message_filters::MessageEvent<MessageType const> EventType;

I tried adding using BaseType = sensor_msgs::msg::CameraInfo and

RCLCPP_USING_CUSTOM_TYPE_AS_ROS_MESSAGE_TYPE(nvidia::isaac_ros::nitros::NitrosCameraInfo, sensor_msgs::msg::CameraInfo);

to nitros_camera_info.hpp, but I still got the same error both times.

Thanks in advance!

Hi @sjchan

Thank you for your topic, and welcome to the Isaac ROS forum.

To better understand why you have this error where coming from, how did you set up your workspace, and how did you compile it?

Best,
Raffaello

Hi @Raffaello ,

Thanks for your response! I’m building this in a custom ROS2 dev container. I have been able to get both NVBlox and VSLAM working well in this container. I could move this testing and building to the provided container if you think that may be a contributing factor to these errors. It is build with colcon.

Hello,

I’ve also got same problem when try to make a rclcpp::Node using isaac_ros::nitros::ManagedNitrosPublisher or isaac_ros::nitros::ManagedNitrosSubscriber to publish, subscribe NITROS’s data type topic. After some testing and researching I found out the ManagedNitrosPublisher is available to use all kind of NITROS data type. But for ManagedNitrosSubscriber, things got very different.

Only the NITORS data type, which folder contant nitros_xxxxx_view.hpp/.cpp can be use in ManagedNitrosSubscriber. The nitros_xxxxx_view.hpp/.cpp will use NITROS_TYPE_VIEW_FACTORY_BEGIN(), which link to nitros_type_view_factory.hpp under isaac_ros_nitros/include, and create another NITROS data type that can be use by ManagedNitrosSubscriber.

It looks like in all kind of NITROS data type, only NitrosImage & NitrosTensorList (which will be NitrosImageView & NitrosTensorListView when using by ManagedNitrosSubscriber) has _view.hpp/.cpp. Using other NITROS data type for ManagedNitrosSubscriber will cause build code fail (no type named “BaseType”).

Also, same as _view.hpp/cpp, NitrosImage & NitrosTensorList are the only two NITORS data type contain nitros_xxxxx_build.hpp/.cpp, which has function to pack the NITROS data type. Others can only use rclcpp::TypeAdapter to force normal ROS 2 data type convert to NITROS data type. Without rclcpp::TypeAdapter or build function, there will be GXF’s error when ManagedNitrosPublisher publish data (Won’t cause node crash but will be no data publish successfully).

Will other NITROS data type update _veiw.hpp/.cpp & _build.hpp/.cpp in future ? Or are there any other ways to deal these problem ?