smartmicro / smartmicro_ros2_radars

ROS2 support for smartmicro radars.
Apache License 2.0
44 stars 19 forks source link

DRVEGRD 171 param file causing runtime error - at least one adapter must be configured #54

Closed triton-epark closed 1 month ago

triton-epark commented 1 month ago

Am running the umrr_ros2_driver with the DRVEGRD 171. As far as I can tell by comparing with the existing parameter yaml files, I have the adapter params written correctly, but am getting runtime errors. What's missing or incorrect?

My params:

/smart_radar:
  ros__parameters:
    adapters:
      adapter_0:
        hw_dev_id: 1
        hw_iface_name: "can0"
        hw_type: "can"
        baudrate: 500000
    master_data_serial_type: can_based
    master_inst_serial_type: can_based
    sensors:
      sensor_0:
        link_type: "can"
        pub_type: "target"
        model: "umrra4_can_v1_0_1"
        dev_id: 1
        id: 101
        frame_id: "umrr"
        history_size: 10
        uifname: "umrra4_t171_automotive"
        uifmajorv: 1
        uifminorv: 0
        uifpatchv: 1

And get the resulting runtime error:

[smartmicro_radar_node_exe-1] [INFO] [1727365282.366125793] [smart_radar]: Updating ADAPTER params.
[smartmicro_radar_node_exe-1] terminate called after throwing an instance of 'std::runtime_error'
[smartmicro_radar_node_exe-1]   what():  At least one adapter must be configured.

Thanks.

sinanyamaan commented 1 month ago

Hi, this is happening because you've set hw_dev_id of your adapter to 1.

Check these out: https://github.com/smartmicro/smartmicro_ros2_radars/blob/ad4e9b211cbfe1d64565ed07559cd841aaadc398/umrr_ros2_driver/src/smartmicro_radar_node.cpp#L93 https://github.com/smartmicro/smartmicro_ros2_radars/blob/ad4e9b211cbfe1d64565ed07559cd841aaadc398/umrr_ros2_driver/src/smartmicro_radar_node.cpp#L2203-L2208

If you set hw_dev_id's of your adapters to 0 or any positive integer other than 1, it will work.