Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoS: Best effort #10

Open
serna01 opened this issue Jul 25, 2024 · 1 comment
Open

QoS: Best effort #10

serna01 opened this issue Jul 25, 2024 · 1 comment

Comments

@serna01
Copy link

serna01 commented Jul 25, 2024

With all the difficulties known around DDS and lossy networks such as WiFi, it becomes a hustle trying to properly get live videos from the leo_rover using Rviz.
I have tried setting up the QoS from Reliable to Best_effort wihtout success yet and thought maybe you could help me:

I cloned the bringup repository to make my custom version:
$ cat src/launch/leo_bringup.launch.xml

       <launch version="0.1.1">
    
      <arg name="qos_reliability" default="best_effort" />
    
      <arg name="spawn_state_publisher"
        default="true"
        description="Whether to start the robot_state_publisher node" />
    
      <arg name="model"
        default="$(find-pkg-share leo_description)/urdf/leo.urdf.xacro"
        description="Absolute path to robot urdf.xacro file" />
    
      <arg name="mecanum_wheels"
        default="false"
        description="Flag specifying wheel types of the robot" />
    
      <arg name="tf_frame_prefix"
        default=""
        description="The prefix added to each published TF frame id" />
    
      <arg name="firmware_override_params_file"
        default=""
        description="Absolute path to the yaml file with firmware parameters to be overrided" />
    
      <include if="$(var spawn_state_publisher)"
        file="$(find-pkg-share leo_description)/launch/state_publisher.launch.xml">
        <arg name="model" value="$(var model)" />
        <arg name="mecanum_wheels" value="$(var mecanum_wheels)" />
      </include>
    
      <node pkg="web_video_server"
        exec="web_video_server" />
    
      <node name="rosbridge_server"
        pkg="rosbridge_server"
        exec="rosbridge_websocket">
        <param name="unregister_timeout" value="86400.0" />
      </node>
    
      <node pkg="rosapi" exec="rosapi_node">
        <param name="topics_glob" value="[*]" />
        <param name="services_glob" value="[*]" />
        <param name="params_glob" value="[*]" />
      </node>
    
      <node pkg="leo_fw" exec="firmware_message_converter">
        <param name="tf_frame_prefix" value="$(var tf_frame_prefix)" />
        <param from="$(find-pkg-share leo_bringup)/config/firmware_message_converter.yaml" />
      </node>
    
      <let if="$(var mecanum_wheels)" name="firmware_default_params_file"
        value="$(find-pkg-share leo_bringup)/config/firmware_mecanum_params.yaml" />
      <let unless="$(var mecanum_wheels)" name="firmware_default_params_file"
        value="$(find-pkg-share leo_bringup)/config/firmware_diff_drive_params.yaml" />
    
      <node pkg="leo_fw" exec="firmware_parameter_bridge">
        <param name="default_params_file_path" value="$(var firmware_default_params_file)" />
        <param name="override_params_file_path" value="$(var firmware_override_params_file)" />
      </node>
    
      <node_container namespace=""
        name="image_container"
        pkg="rclcpp_components"
        exec="component_container">
        <composable_node namespace="camera"
          name="v4l2_camera"
          pkg="v4l2_camera"
          plugin="v4l2_camera::V4L2Camera">
          <param from="$(find-pkg-share leo_bringup)/config/v4l2_camera.yaml" />
          <param name="camera_frame_id" value="$(var tf_frame_prefix)camera_optical_frame" />
          <extra_arg name="use_intra_process_comms" value="true" />
          <param name="qos_reliability" value="best_effort" />
        </composable_node>
        <composable_node namespace="camera"
          name="debayer"
          pkg="image_proc"
          plugin="image_proc::DebayerNode">
          <extra_arg name="use_intra_process_comms" value="true" />
        </composable_node>
        <composable_node namespace="camera"
          name="rectify_mono"
          pkg="image_proc"
          plugin="image_proc::RectifyNode">
          <extra_arg name="use_intra_process_comms" value="true" />
          <remap from="image" to="image_mono" />
          <param name="qos_reliability" value="best_effort" />
        </composable_node>
        <composable_node namespace="camera"
          name="rectify_color"
          pkg="image_proc"
          plugin="image_proc::RectifyNode">
          <extra_arg name="use_intra_process_comms" value="true" />
          <remap from="image" to="image_color" />
          <remap from="image_rect" to="image_rect_color" />
          <remap from="image_rect/compressed" to="image_rect_color/compressed" />
          <param name="qos_reliability" value="best_effort" />
        </composable_node>
      </node_container>

  <node pkg="leo_bringup"
    exec="leo_system" />
    </launch>

Modified the camera yaml:
cat src/config/v4l2_camera.yaml

  /**:
    ros__parameters:
      video_device: /dev/video0
      pixel_format: YUYV
      output_encoding: rgb8
      image_size: [640, 480]
      time_per_frame: [1, 30]
      camera_info_url: package://leo_bringup/camera_info/leo_camera.yaml
      qos_reliability: best_effort
      qos_history: keep_last
      qos_depth: 10

$ nano /etc/ros/setup.bash

source /opt/ros/humble/setup.bash
#source /home/pi/ros2_ws/install/setup.bash
source /home/pi/leo_bringup/install/setup.bash

# Path to the launch file to start.
LAUNCH_FILE="/etc/ros/robot.launch.xml"

# Arguments passed to ros2 launch command
LAUNCH_ARGS=""

# Arguments passed to Micro-ROS agent
UROS_AGENT_ARGS="serial -D /dev/serial0 -b 460800"

### ROS Environment Variables
#export ROS_DOMAIN_ID=10
#export ROS_NAMESPACE="leo1"
#export ROS_LOCALHOST_ONLY=1
export RCUTILS_COLORIZED_OUTPUT=1

Any suggestions on how to change the QoS for the camera topic on the debayer node?

Thanks

@bjsowa
Copy link
Member

bjsowa commented Jul 30, 2024

There is no option in ROS Humble to override QoS of image_proc nodes. That option seems to be available from ROS Jazzy.

Do you use the compressed topics in Rviz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants