Robotmodel with real ROSbot problem

Hello,

I have a ROSbot but i can’t get the Robotmodel work in Rviz. I launced the tutorial files and tried to add URDF files but it didnt work out. Please let me know how to get a RobotModel in Rviz with the real ROSbot and no simulation

Hello R_M,

To add ROSbot model in Rviz while using real ROSbot, you will need to edit launch files.

To make ROSbot model visible in Rviz you need to define rosbot_desciption parameter:

<param if="$(arg use_rosbot)" name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>

Further you will need robot_state_publisher node to publish model parameters:

<node if="$(arg use_rosbot)" name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>

Last, you will need tf publishers for wheels:

<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="fl_publisher" args="0.05 0.11 0 0 0 0 base_link front_left_wheel 250" />
<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="fr_publisher" args="0.05 -0.11 0 0 0 0 base_link front_right_wheel 250" />
<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="rl_publisher" args="-0.05 0.11 0 0 0 0 base_link rear_left_wheel 250" />
<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="rr_publisher" args="-0.05 -0.11 0 0 0 0 base_link rear_right_wheel 250" />

As you may notice they are static, so wheels will not spin in visualization, publishing of wheels angular position is currently not supported.

For example, the tutorial_3.launch with above changes will be as follows:

<launch>

    <arg name="use_rosbot" default="true"/>
    <arg name="use_gazebo" default="false"/>

    <include if="$(arg use_rosbot)" file="$(find astra_launch)/launch/astra.launch"/>
    <include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/rosbot_world.launch"/>
    <include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/rosbot.launch"/>

    <param if="$(arg use_rosbot)" name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
    <node if="$(arg use_rosbot)" name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="fl_publisher" args="0.05 0.11 0 0 0 0 base_link front_left_wheel 250" />
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="fr_publisher" args="0.05 -0.11 0 0 0 0 base_link front_right_wheel 250" />
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="rl_publisher" args="-0.05 0.11 0 0 0 0 base_link rear_left_wheel 250" />
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="rr_publisher" args="-0.05 -0.11 0 0 0 0 base_link rear_right_wheel 250" />

    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find tutorial_pkg)/rviz/tutorial_3.rviz"/>

    <node name="teleop_twist_keyboard" pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" output="screen"/>

</launch>

You will need to edit launch file for each tutorial that you want to make the ROSbot model visible.

Regards,
Łukasz