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

How to implement open package to my robot?

asked 2017-09-21 06:27:03 -0500

Sunje gravatar image

updated 2017-09-23 09:21:45 -0500

Hi, I am not that good at ROS

I want to implement rrt_package(rrt_exploration, rrt_exploration_tutorial) to my (turtlebot3 robot). The rrt package is based on kobuki robot so I thought it is necessary to remap topic names in the rrt_package with the topic names what turtlebot3 uses. I made some launch files based on the turtlebot3_model.launch file in the turtlebot3_bringup package and I have included some scripts from the single_simulated_house.launch in the rrt_exploration_tutorial package.

I expected my turtlebot3 robot to operate like here but it was not. Master(desktop) did not seem to receive scan data from turtlebot3. Turtlebot3 works well when starting the turtlebot3 package, so it is free from defects.

Bellow are my launch files.

Main launch file: turtlebot3 bring up launch(based on turtlebot3_model.launch in turtlebot3_bringup package)

<launch>
<!--group ns="/robot_1"-->

  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle]"/>

  <include file="$(find turtlebot3_bringup)/launch/includes/turtlebot3_rrt_robot_description.launch.xml">
    <arg name="model" value="$(arg model)" />
  </include>

  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
    <param name="publish_frequency" type="double" value="50.0" />
    <param name="use_tf_static" type="bool" value="false" />
    <param name="tf_prefix" type="string" value="$(arg model)"/>    
  </node>

  <include file="$(find turtlebot3_bringup)/launch/includes/rrt.launch">
    <!--arg name="namespace" value="robot_1"/-->  
  </include> 

<!--/group-->

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find turtlebot3_description)/rviz/model.rviz">
  <!--node pkg="rviz" type="rviz" name="rviz" args="-d $(find rrt_exploration_tutorials)/launch/includes/rviz_config/single.rviz"-->
    <!--remap from="move_base_simple/goal" to="robot_1/move_base_simple/goal"/-->
  </node>

</launch>

Turtlebot3 description xml file(based on description.launch.xml in turtlebot3_bringup package)

<launch>
  <arg name="model"/>
  <arg name="urdf_file" default="$(find xacro)/xacro.py '$(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro'" />
  <param name="robot_description" command="$(arg urdf_file)" />
</launch>

RRT launch file(based on move_baseSafe.launch in rrt_exploration_tutorial package)

<!-- move base -->
<launch>
  <master auto="start"/>

  <!--arg name="namespace"/-->

  <param name="use_sim_time" value="true" />

  <node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen" >
    <remap from="scan" to="base_scan"/>

      <!--param name="map_frame" value="$(arg namespace)/map"/-->
<param name="map_frame" value="map"/>
      <!--param name="odom_frame" value="$(arg namespace)/odom"/-->
<param name="odom_frame" value="odom"/>
      <!--param name="base_frame" value="$(arg namespace)/base_link"/-->
<param name="base_frame" value="base_link"/>

    <param name="map_update_interval" value="2.0"/>
    <param name="maxUrange" value="50.0"/>
    <param name="maxRange" value="50.0"/>
    <param name="sigma" value="0.05"/>
    <param name="kernelSize" value="1"/>
    <param name="lstep" value="0.05"/>
    <param name="astep" value="0.05"/>
    <param name="iterations" value="5"/>
    <param name="lsigma" value="0.075"/>
    <param name="ogain" value="3.0"/>
    <param name="lskip" value="0"/>
    <param name="srr" value="0.01"/>
    <param name="srt" value="0.02"/>
    <param name="str" value="0.01"/>     
    <param name="stt" value="0.02"/>
    <param name="linearUpdate" value="0.01"/>
    <param name="angularUpdate" value="0.01"/>
    <param name="temporalUpdate" value="0.1"/>
    <param name="resampleThreshold" value="0.5"/>
    <param name="particles" value="30"/>
    <param name="xmin" value="-5.0"/>
    <param name="ymin" value="-5.0"/>
    <param name="xmax" value="5.0"/>      
    <param ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-09-21 08:37:37 -0500

hasauino gravatar image

updated 2017-09-21 12:29:18 -0500

It should work with any robot that receives velocity commands and publishes TF, odometery, and laser scan. Turtlebot3 does all that, so it should work. However, I'm not familiar with Turtlebot3 launch files.

To get the full picture, can you please show topic names? and also your TF tree, while everything is running?

For it to work, robot node names, topics and frames, all have to be prefixed by "robot_1". One way to do that is by using <group ns="/robot_1"> in your launch files. Your TF tree should look like this:

image description

Your topic names should be like this:

image description

So before you run the rrt_exploration package. Make sure you get this.

====================================================

Since you are using a physical robot, <param name="use_sim_time" value="true" />, this parameter should be set to false.

In your launch files you removed everything related to "robot_1" namespace, this is wrong, everything (node names, topics and frames in TF) should be prefixed by "robot_1". This is why the move_baseSafe.launch takes the namespace as an argument.

edit flag offensive delete link more

Comments

Thanks for your reply hasauino! I really want to use your package. The thing is, I am doing on a physical robot, not on the gazebo simulation. So I execute turtlebot3 robot and run the launch file that I wrote above. But it doesn't work like your youtube real test movie.

Sunje gravatar image Sunje  ( 2017-09-21 08:57:27 -0500 )edit

Ok, it should work with your robot. if you are using a real robot, why are you using "use_sim_time" value="true", this should be set to false. You didn't add screenshots for your TF tree and node names. If you do I can help.

hasauino gravatar image hasauino  ( 2017-09-21 09:21:47 -0500 )edit

I changed the value to "false" as you advised but it still doesn't work. I uploaded TF tree, topic names and node names. Thanks for your help.

Sunje gravatar image Sunje  ( 2017-09-21 10:09:57 -0500 )edit

the pictures you added are not showing for the TF and rqt graph. As I told you earlier, you have to prepare your robot. Check Setting up your robot section. Also this

hasauino gravatar image hasauino  ( 2017-09-21 11:37:04 -0500 )edit

I re-linked image of url. As you can see all the names don't start with /robot_1. The problem is I want to make topics to start with /robot_1 but I don't know how to do that. If I just copy your script and run the following error came up:

Sunje gravatar image Sunje  ( 2017-09-21 12:29:07 -0500 )edit

Timed out waiting for transform from robot_1/base_link to robot_1/map to become available before running costmap, tf error: canTransform: source_frame robot_1/base_link does not exist.. canTransform returned after 0.100975 timeout was 0.1.

Should I have to change robot description file?

Sunje gravatar image Sunje  ( 2017-09-21 12:35:01 -0500 )edit

I have edited my answer.

to prefix all nodes in a launch (its name, and its topics) with a namespace (in our case robot_1), you simply wrap your launch file with the "group ns" tag.

hasauino gravatar image hasauino  ( 2017-09-21 12:35:11 -0500 )edit

No, I don't think robot description has anything to do with that, it just publishes URDF model to RVIZ for visualization.

I still don't have your topic names and TF tree, it's hard to tell. Bu the problem is with topic names. You have to make sure of them.

hasauino gravatar image hasauino  ( 2017-09-21 12:41:04 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-09-21 06:25:22 -0500

Seen: 794 times

Last updated: Sep 23 '17