Setup RTAB map on Volksbot Rt3

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi

I want to setup Rtabmap on my volksbot RT3, it have a base_link and SICK LMS1 sensor. I also see tutorial on

http://wiki.ros.org/rtabmap_ros/Tutorials/SetupOnYourRobot

But I not understand this line:
" If your robot has odometry: the robot should publish his odometry in nav_msgs/Odometry format."

My robot has odometry in volksbot_driver. Should I put this in folder rtabmap?

Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,

no, when you launch the robot's bring up launch file, you may have a nav_msgs/Odometry published by the robot driver (see volksbot_node.cpp, and the odometry topic seems to be called directly "odom"). You can then remap this topic in rtabmap node:
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="--delete_db_on_start">
    <remap from="odom" to="/odom"/>
    ...
</node>

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi Mathieu,

You are amazing tutor, I see you spent your time to answer every question form people and you reply so quick!

I just have a noob question for you. I do follow what you said but when I run .launch files it can't talk with my kinect,the launch files like this.



I also check rtq_tf_tree and everything is working.



finally, here is my .launch files




Could you explain me how to run on my robot, follow what i understand, rtabmap-SLAM will take information from odometry and laser scanner at inputs, then it will use filters to estimate the path planning, is it correct?
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,
as the warning suggests, are these topics published?
$ rostopic hz /rtabmap/volksbot_node/odom
$ rostopic hz /camera/rgb/image_rect_color
$ rostopic hz /camera/depth_registered/image_raw
$ rostopic hz /camera/rgb/camera_info

I think you may have a typo to subscribe to volksbot odometry, add a leading "/" to remap so it is not in rtabmap namespace (/volksbot_node/odom instead of /rtabmap/volksbot_node/odom):
<remap from="odom" to="/volksbot_node/odom"/>

You don't need the rviz stuff in your launch file, it is just to show current cloud of the kinect in rviz. If you want to keep it, if you are on the same computer, use same remap of rgb/depth topics like the rtabmap node (compressed can be removed too), as "data_throttled_image" may not be published.

You are also missing a static transform between base_link and camera_link, in launch file add:
<node pkg="tf" type="static_transform_publisher" name="camera_base_link" 
   args="0 0 0 0 0 0 base_link camera_link 100" />  
The "0 0 0 0 0 0" are "x y z yaw pitch roll" values, adjust to right position accordingly to base_link.

EDIT
For your last question, you don't have a laser scan set in rtabmap node. If one is set, it is used to create a 2d occupancy grid map that can be used for navigation (the map input "/map" of move_base's global costmap).

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi,

I want to ask you form yesterday but I think I should try do solve the proplem myself first. Yes you right, I change <remap from="odom" to="/odom"/> and everything work.

then I tried another example which you had answer to another guy in Oct 30 2015. Wow, just a long time ago, this is what you said.



I do following what you said except the : roslaunch navigation.launch map_topic:=/rtabmap/grid_map
because I see you create costmap_common, local cost map, global costmap, base_local_planner and navigation.launch files and I have no idea about these files. I already git clone the navigation stack package from github but I still cannot run move_base because there are no move_base.launch.

An this is my transform tree after I run this line roslaunch rtabmap_ros demo_turtlebot_rviz.launch


The result in rviz also good, I can see my camera and my robot connected.



Now I cant drive my robot to some_where to create a map. But I want to use move_base, could you enlighten me what to do next? I saw on youtube that after we have a map we can set the goal and robot wil navigate to this pos automatically and avoid obstacle when moving.
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
In reply to this post by matlabbe
Hi,

I already do follwing your tutorial, now i can create the navigation.launch like I post below:

$ roslaunch freenect_launch freenect.launch depth_registration:=true

$ rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/camera/depth_registered/image_raw camera_info:=/camera/depth_registered/camera_info

$ rosrun tf static_transform_publisher 0 0 0 0 0 0 /base_footprint /camera_link 100

$ roslaunch rtabmap_ros rgbd_mapping.launch frame_id:=base_footprint rtabmap_args:="--delete_db_on_start" rtabmapviz:=false subscribe_scan:=true

$ roslaunch navigation.launch map_topic:=/rtabmap/grid_map

I create the navigation.launch like this



and the result is



But why on the tf tree the local and global cost map still not display?, it just like this.



Could you help me to solve this,

Thank you very much
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
This post was updated on .
Hi,

For reference, I put the link to example of October 2015 you referred: http://official-rtab-map-forum.206.s1.nabble.com/Autonomous-Navigation-td801.html

The costmaps are not TF, they won't be shown in TF tree. Show rqt_graph instead and look inside move_base node (as shown in the rqt_graph screenshot you have shown above). The costmap topics are there. You can see them in RVIZ by subscribing to a Map display and selecting one of the costmap topic (you can change color overlay in the display parameters).

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi Mathieu.

Thanks you very much, I did it!!,

here is my volksbot and what my volks bot visualization,





But did you saw the laser, it red, an the laser scanner did not receive any data. althought I already connect to my laser scanner(it is sick lms1xx). You can see it in my rqt_graph.



one more question, when I run the navigation.launch like in your reference, it say the origin sensor position is out of map bounds, what does it mean?



Thanks for your time, you are my best tutor!
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,

normally you should use /map as Fixed Frame in RVIZ (see Global Options). The scan error may be that it cannot transform the laser scan in /camera_rgb_frame (which is your fixed frame). Just click the little arrow on left of "Status: Error" to have more info about the error.

Which node is publishing "out of map bounds" warnings? You can use rqt_console to know it.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Dear Mathieu,

Thank you, I solve the problem. But I have some question:

1/ I still don't know how to make robot plans a path inside the mapped environment to reach the provided goal? I already create a map by driving my robot round the room, them I saved that map, so what I need to do next find the acml.launch, is it correct?

2/ If the robot can plans a path inside the mapped environment to reach the provided goal. It is path planning, isn't it? If I want my volksbot move automaticaly and draw the map in the same time, I mean SLAM, is it possible?

Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,

1) Normally, you can send a goal to move_base on /move_base_simple/goal topic (this can be done through RVIZ 2D pose tool). Show "Path" displays for path topics computed by move_base to debug (to see acutal path planned). You don't need amcl with the saved rtabmap.db. Just relaunch the same launch file for rtabmap but without "--delete_db_on_start" and parameter "Mem/IncrementalMemory" set to false:
<node pkg="rtabmap_ros" type="rtabmap" name="rtabmap">
    ...
    <param name="Mem/IncrementalMemory" type="string" value="false"/>
</node>

rtabmap will reload the same database (default ~/.ros/rtabmap.db) in read-only mode. You may need to teleoperate the robot a little so it can localize. After being localized, /map->/odom will be published as well as the map.

2) Yes, it is possible to send goals while rtabmap is in SLAM mode. In other words, autonomous exploration is possible.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Dear Mathieu,

It work!!! Thanks you verry much!, I can use  RVIZ 2D pose tool to make the robot move in previous map.

There are a lot of .launch files I need to run an it complicated, so I want to put all of them in only one file, an I decide to choose your az3_mapping_robot_kinect_scan.launch to modify:





I have some point not clear in this launch files,
1/ what is az3_abtr priority, do I need this for my volksbot,

2/ where is the line you use to link to az3_nav.rviz configuration files? because i want to link to volksbot configuration files. I mean this one <node name = "rviz" type ="rviz" args ="-d$(find rtabmap_ros)/launch/config/volksbot_navigation.rviz">

3/ The last question, in the last lines, I see "throttling message". Are they used for remote control? if  I want to control my robot from another computer. I need to do two think:
  3.1/ on robot: roslaunch freenect_throttle.launch
  3.2/ on client: export ROS_MASTER_URI = "http://"myrobot_ip"
                       roslaunch az3_mapping_robot_kinect_scan.launch

Is it correct? Thank you and sorry to ask you a lot of question.

Best Regards,

Thanh Nguyen

Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,

1) az3_abtr is arbitration between joystick vs move_base's cmd_vel. Joystick has priority: if we push the deadman switch on the joystick, commands from move_base are not sent to robot base controller, but those from the joystick.

2) That launch file brings up all stuff on the robot. For rviz, it is another launch file started on client computer. See az3_mapping_client.launch.

3) kinect throttling was done for the remote computer, to get some live point clouds to show, which can be convenient for teleoperation. Don't connect them to remote computer to save bandwidth if you are just sending goal to move_base with RVIZ.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi Mathieu,

Last weekend I can use 2D Nav Goal but today I got problem although I do everything exactly the same.



first I create a map with :

roslaunch rtabmap_ros rgbd_mapping.launch frame_id:=base_footprint rtabmap_args:="--delete_db_on_start" rtabmapviz:=false subscribe_scan:=true

then I localize with :

roslaunch rtabmap_ros rgbd_mapping.launch frame_id:=base_footprint rtabmapviz:=false subscribe_scan:=true localization:=true

but the program said that my robot start position is off global costmap, I alredy check with rqt_console and this from move_base node .


Best Regard.
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,

When restarting in localization mode, is the robot localized in previous map before sending the goal?
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi,


Yes I sure in localization mode, the robot localized in previous map. When I run  :  

roslaunch rtabmap_ros rgbd_mapping.launch frame_id:=base_footprint rtabmapviz:=false subscribe_scan:=true localization:=true

The Rviz display robot localize in previous map, sometime I need to use teleop a little to make robot move a little to display the map or I must download map from Rtbmap Cloud in Rviz. But when I sent command 2D navigation goal, the navigation.launch files said "robot start position is off global costmap".


Today I test 50 times, two times the robot run, but it just go to the goal, it not avoid obstacle, although they already on the previous map. Other time, it always said "robot start position is off global costmap".

matlabbe wrote
Hi,

When restarting in localization mode, is the robot localized in previous map before sending the goal?
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
Hi,

After the robot is localized, can you show TF values? for /map -> /odom and /odom ->/base_link?
$ rosrun tf tf_echo /map /odom
$ rosrun tf tf_echo /odom /base_link

Also can you show the /map info message?
$rostopic echo /map/info

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi Mathieu,

 /map -> /odom


/odom ->/base_link


/map/info display nothing


ant here in my navigation.launch I used global cost map and local cost map configuration from your azimut3. do you think it is problem?


Cheers, ^_^
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

matlabbe
Administrator
I was referring to /rtabmap/grid_map topic (the map used for the global costmap).
$ rostopic echo /rtabmap/grid_map/info

Note also that you may use costmap_common_params_2d.yaml instead of costmap_common_params.yaml, otherwise the obstacle layer is not defined.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Setup RTAB map on Volksbot Rt3

thanhnguyen
Hi Mathieu,

I come back to ask you question ^_^ :))

I already can run the navigation.launch, when I turn on localization mode the robot can move to this position:

Navigation.launch:

<launch>
  <arg name="scan_topic" default="/scan"/>
  <arg name="map_topic" default="/map"/>

 
  <remap from="scan"             to="$(arg scan_topic)"/> 
  <remap from="map"              to="$(arg map_topic)"/>   
       
  <node pkg="move_base" type="move_base" respawn="true" name="move_base" output="screen">
     
     <rosparam file="$( find rtabmap_ros)/launch/costmap_common_params.yaml" command="load" ns="global_costmap" />
     <rosparam file="$( find rtabmap_ros)/launch/costmap_common_params.yaml" command="load" ns="local_costmap" />
     <rosparam file="$(find rtabmap_ros)/launch/local_costmap_params.yaml" command="load" ns="local_costmap" />
     <rosparam file="$(find rtabmap_ros)/launch/global_costmap_params.yaml" command="load" ns="global_costmap"/>
     <rosparam file="$(find rtabmap_ros)/launch/base_local_planner_params.yaml" command="load" />
  </node>
</launch>


But my robot can't avoid the obstacle, as you said I should use costmap_common_params_2d.yaml but when I use it not have point could sensor A and point could sensor B:




Thank you very much
12