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

SLAM Gmapping map to odom remapping error

asked 2019-01-15 14:06:50 -0500

hdbot gravatar image

updated 2019-01-19 13:09:42 -0500

Hello,

I am trying to perform slam_gmapping for my project, and using filtered odometry obtained using ekf. However, the tf_tree shows that map->odom (this is for slam_gmapping), and second side of the tree has map->/odometry/filtered (this is ekf odometry).

I am attaching my file which classifies tfs, and the tf diagram I got while running the system. I have remapped odom->/odometry/filtered in the slam_gmapping section of the code, but seems like it is not being activated. Currently, no map is being received.

Can anyone tell me how to fix it so I can map the environment using the filtered odometry from ekf for gmapping?

This is the tf when the code runs first time: C:\fakepath\tf.png

This is the tf I get after waiting few minutes and finding the tf: C:\fakepath\frames.png

Code:

<launch> 

  <arg name="frame_id"                default="/base_link" />
  <arg name="rgb_topic"               default="/zed/rgb/image_rect_color" />
  <arg name="depth_topic"             default="/zed/depth/depth_registered" />
  <arg name="camera_info_topic"       default="/zed/rgb/camera_info" />
  <arg name="imu_topic"               default="/imu/data" />
  <arg name="imu_ignore_acc"          default="true" />
  <arg name="imu_remove_gravitational_acceleration" default="false" />
  <arg name="wheelchair"          default="/odom"/>
  <arg name="rtabmap_args"            default=""/>

<!--Wheelchair Launch-->

<node pkg="roboteq_driver" type="driver_node" name="roboteq_driver" output="screen">
    <!-- enable broadcast of odom tf -->
    <param name="pub_odom_tf" value="true" />
    <!-- specify odom frame -->
    <param name="odom_frame" value="odom" />
    <!-- specify base frame -->
    <param name="base_frame" value="wheelchair_base" />
    <!-- specify cmd_vel topic -->
    <param name="cmdvel_topic" value="cmd_vel" />
    <!-- specify port for roboteq controller -->
    <param name="port" value="/dev/ttyACM0" />
    <!-- specify baud for roboteq controller -->
    <param name="baud" value="115200" />
    <!-- specify whether to use open-loop motor speed control (as opposed to closed-loop)-->
    <param name="open-loop" value="false" />
    <!-- specify robot wheel circumference in meters  -->
    <param name="wheel_circumference" value="0.3429" />
    <!-- specify robot track width in meters  -->
    <param name="track_wdith" value="0.5715" />
    <!-- specify pulse-per-revolution for motor encoders  -->
    <param name="encoder_ppr" value="900" />
    <!-- specify counts-per-revolution for motor encoders (ppr*4 for quadrature encoders)  -->
    <param name="encoder_cpr" value="3600" />
</node>

<!--Zed Camera Launch-->

<group ns="zed">
    <node name="zed_wrapper_node" pkg="zed_wrapper" type="zed_wrapper_node" />
</group>

<!-- Depth_image to Laser_Scan -->
<node pkg="depthimage_to_laserscan" type="depthimage_to_laserscan" name="depthimage_to_laserscan">
        <param name="scan_height" value="100"/>
        <param name="output_frame_id" value="/base_frame"/>
        <param name="range_min" value="0.3"/>
        <param name="range_max" value="60"/>
        <remap from="image" to="/zed/depth/image_rect_color"/>
    <remap from="scan" to ="/scan"/>
 </node>


<!-- Laser Scan Match -->
<node pkg="laser_scan_matcher" type="laser_scan_matcher_node" name="laser_scan_matcher_node" output="screen">

    <param name="fixed_frame" value = "odom"/>
    <param name="base_frame" value="base_link"/>
    <param name="use_alpha_beta" value="false"/>
    <param name="use_odom" value="false"/>
    <param name="use_imu" value="false"/>
    <param name="max_iterations" value="10"/>
    <param name="publish_pose" value="true"/>
    <param name="publish_tf" value="true"/>
    <param name="use_vel" value="false"/>

 </node>

<!-- IMU: MPU6050 Launch -->
<node pkg="mpu6050_serial_to_imu" type="mpu6050_serial_to_imu_node" name="mpu6050_serial_to_imu_node">
      <param name="frame_id"                       value="imu_link"/>
      <param name="remove_gravitational_acceleration" type="bool" value="true"/>
</node>

<!-- Static Transform (TF) -->

<!--<node pkg="tf" type="static_transform_publisher" name="wheelchair_base" args=" 0.0 0.0 0.0 0 0 0  /map /odometry/filtered 100" /> -->
<node pkg="tf" type="static_transform_publisher" name="wheelchair" args=" -9.0 ...
(more)
edit retag flag offensive close merge delete

Comments

Hi i am new in this field. can you please help me regarding my problem written bellow:

In an industrial field, one robot will pick up the apples and sort them out. The robot will move fast. In that case, if any human is near to robot it should be slow down. For that purpose, I want to use Rplidar

kazi ataul goni gravatar image kazi ataul goni  ( 2019-01-16 05:19:47 -0500 )edit

@kazi ataul goni, you may want to post this question in the forum. This way lot more people will be able to help.

hdbot gravatar image hdbot  ( 2019-01-16 10:22:46 -0500 )edit

sorry to post it here. i already did ..but nobody replied. and i thought may be you could help .. i really dont know what should i do after i have done the slam. should i do the image processing on slam or there is another to find out the obstacle form slam? @hdbot

kazi ataul goni gravatar image kazi ataul goni  ( 2019-01-16 16:57:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-01-16 04:18:04 -0500

curi_ROS gravatar image

updated 2019-01-16 04:19:09 -0500

I noticed a couple of things in your launch file:

/odometry/filtered is a topic published by EKF Localisation and not a frame. Remapping it to /odom makes it available on the topic /odom which can be used by laser_scan_matcher.

You do not need these static transform publishers between map and odometry/filtered/. The transform between map -> odom will be published by gmapping.

I am not sure what your base_link is called as you have also used it as the name of a static_transform_publisher and also the name of your base_frame. You need to provide a transform between laser_frame -> base_link, with a static transform publisher. In your case base_frame to base_link (or however you call it in your URDF file).

You also need a transform between base_link and odom. If you want to use Laser Scan Matcher for this transform, change your base_frame to base_link

Hope this helps!

edit flag offensive delete link more

Comments

I did the modifications, but I am still getting no map received. The tf looks like it flows properly when i run it the first time, but when I run the tf again without any changes the frames change. I am not sure why. Can you explain how I can fix that? I have updated the question with modifications.

hdbot gravatar image hdbot  ( 2019-01-19 13:03:04 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-01-15 14:06:50 -0500

Seen: 1,174 times

Last updated: Jan 19 '19