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

What should be published in /clock when using a real robot?

asked 2023-01-03 01:04:26 -0600

updated 2023-01-04 01:05:11 -0600

I want to visualise my robot's odometry. I have a physical 4-wheel robot with me. They publish when the encoder ticks and the IMU values. To get the fused data and the tf from base_link to odom frame I am using the robot_localization package. Unfortunately, there is no data being published in odometry/filtered and accel/filtered.

This issue is similar to mine. The solution given there is to start Gazebo properly so that data gets published in the clock/ topic. But I do not want to simulate in Gazebo. I have a physical robot with me!

Setting use_sim_time to False doesn't solve the problem.

This is my eky.yaml file used by the robot_localization node:

### ekf config file ###
ekf_filter_node:
    ros__parameters:
        frequency: 30.0
        two_d_mode: false
        publish_acceleration: true
        publish_tf: true
        #map_frame: map              # Defaults to "map" if unspecified
        odom_frame: odom            # Defaults to "odom" if unspecified
        base_link_frame: base_link  # Defaults to "base_link" ifunspecified
        world_frame: odom           # Defaults to the value ofodom_frame if unspecified

        odom0: encoder/odom
        odom0_config: [true,  true,  true,
                       false, false, false,
                       false, false, false,
                       false, false, true,
                       false, false, false]

        imu0: camera/imu
        imu0_config: [false, false, false,
                      true,  true,  true,
                      false, false, false,
                      false, false, false,
                      false, false, false]

Here is the display.launch.py file that I am using:

import os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition, UnlessCondition
from launch.substitutions import Command, LaunchConfiguration
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch_ros.descriptions import ParameterValue

def generate_launch_description():

  # Set the path to this package.
  pkg_share = FindPackageShare(package='r23_description').find('r23_description')

  # Set the path to the RViz configuration settings
  default_rviz_config_path = os.path.join(pkg_share, 'rviz/rviz_basic_settings.rviz')

  # Set the path to the URDF file
  default_urdf_model_path = os.path.join(pkg_share, 'urdf/r23_description.urdf')

  # Launch configuration variables specific to simulation
  gui = LaunchConfiguration('gui')
  urdf_model = LaunchConfiguration('urdf_model')
  rviz_config_file = LaunchConfiguration('rviz_config_file')
  use_robot_state_pub = LaunchConfiguration('use_robot_state_pub')
  use_rviz = LaunchConfiguration('use_rviz')
  use_sim_time = LaunchConfiguration('use_sim_time')

  # Declare the launch arguments  
  declare_urdf_model_path_cmd = DeclareLaunchArgument(
    name='urdf_model', 
    default_value=default_urdf_model_path, 
    description='Absolute path to robot urdf file')

  declare_rviz_config_file_cmd = DeclareLaunchArgument(
    name='rviz_config_file',
    default_value=default_rviz_config_path,
    description='Full path to the RVIZ config file to use')

  declare_use_joint_state_publisher_cmd = DeclareLaunchArgument(
    name='gui',
    default_value='True',
    description='Flag to enable joint_state_publisher_gui')

  declare_use_robot_state_pub_cmd = DeclareLaunchArgument(
    name='use_robot_state_pub',
    default_value='True',
    description='Whether to start the robot state publisher')

  declare_use_rviz_cmd = DeclareLaunchArgument(
    name='use_rviz',
    default_value='True',
    description='Whether to start RVIZ')

  declare_use_sim_time_cmd = DeclareLaunchArgument(
    name='use_sim_time',
    default_value='False',
    description='Use simulation (Gazebo) clock if true')

  # Specify the actions

  # Publish the joint state values for the non-fixed joints in the URDF file.
  start_joint_state_publisher_cmd = Node(
    condition=UnlessCondition(gui),
    package='joint_state_publisher',
    executable='joint_state_publisher',
    name='joint_state_publisher')

  # A GUI to manipulate the joint state values
  start_joint_state_publisher_gui_node = Node(
    condition=IfCondition(gui),
    package='joint_state_publisher_gui',
    executable='joint_state_publisher_gui',
    name='joint_state_publisher_gui')

  # Subscribe to the joint states of the robot, and publish the 3D pose of each link.
  start_robot_state_publisher_cmd = Node(
    condition=IfCondition(use_robot_state_pub),
    package='robot_state_publisher',
    executable='robot_state_publisher',
    parameters=[{'use_sim_time': use_sim_time, 
    'robot_description': ParameterValue(Command(['cat ',default_urdf_model_path,]), value_type=str)}],
    arguments=[default_urdf_model_path])

  # Launch RViz
  start_rviz_cmd = Node(
    condition=IfCondition(use_rviz),
    package='rviz2',
    executable='rviz2',
    name='rviz2',
    output='screen',
    arguments=['-d', rviz_config_file ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2023-01-04 06:44:20 -0600

I am getting the values in the accel/filtered and odometry/filtered once I fixed my tf tree. I had to set the transforms between odom => base_link.

If you are using wheel encoders, this may help you transform wheel ticks to odometry data and publish the base_link to odom transformation.

If you are using an imu (I am using an integrated on: Intel Realsense D435i), this node publishes the required transformation. Check out this also.

edit flag offensive delete link more

Comments

What should be published in /clock when using a real robot?

I'll point out that this is not an answer to the question in the title of this post.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-04-15 08:08:23 -0600 )edit
0

answered 2023-04-13 19:54:56 -0600

an9999 gravatar image

I am currently encountering this issue. Looking at the diagnostic topics, i get weird message. I tried with their example and its giving me the same error.

header: seq: 10 stamp: secs: 1681433431 nsecs: 668788538 frame_id: '' status: - level: 2 name: "ekf_navigation_node: Filter diagnostic updater" message: "Erroneous data or settings detected for a robot_localization state estimation node." hardware_id: "none" values: - key: "PITCH_configuration" value: "Neither PITCH nor its velocity is being measured. This will result in unbounded error\ \ growth and erratic filter behavior." - key: "ROLL_configuration" value: "Neither ROLL nor its velocity is being measured. This will result in unbounded error\ \ growth and erratic filter behavior." - key: "X_configuration" value: "Neither X nor its velocity is being measured. This will result in unbounded error\ \ growth and erratic filter behavior." - key: "YAW_configuration" value: "Neither YAW nor its velocity is being measured. This will result in unbounded error\ \ growth and erratic filter behavior." - key: "Y_configuration" value: "Neither Y nor its velocity is being measured. This will result in unbounded error\ \ growth and erratic filter behavior." - key: "Z_configuration" value: "Neither Z nor its velocity is being measured. This will result in unbounded error\ \ growth and erratic filter behavior."

edit flag offensive delete link more

Comments

Please do not hijack someone else's question, especially in the "answer section" if you are not providing an answer.

We prefer that you create a new question of your own. In the new description, you can include a url link to this page if you think it helps explain the problem you are having.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-04-15 08:11:56 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2023-01-03 01:04:26 -0600

Seen: 253 times

Last updated: Apr 13 '23