0
$\begingroup$

Rosanswers logo

Hello,

I'm a relatively new ROS user trying to get a Clearpath HUSKY to create maps using a Hokuyo LIDAR. I'm using a headless Ubunto running ROS Kinetic. I'm am able to connect and drive the system around successfully using teleop_twist_keyboard and am successfully passing data along. However, when I go to retrieve the map using "rosrun map_server map_saver", the scan data appears to be overlaying and rotating only along the origin point rather than constructing an actual map. (I don't have enough karma points to attach a picture currently). Ex: Going down a hallway and turning around and driving back, there will be multiple hallway scans rotated about the origin rather than having one singular hallway appear.

The relevant portion of the tf tree looks like map->odom->base_link->laser, and I did create the nodes for the links between odom/base_link and base_link/laser. Both the links display the correct broadcaster and connections when viewed in the tf tree (sadly no pictures at the moment still).

Here is my code for the odom link:

#! /usr/bin/env python
import roslib
roslib.load_manifest('tf_custom')

import rospy
import tf

if __name__ == '__main__':
    rospy.init_node('odom_tf')
    br = tf.TransformBroadcaster()
    rate = rospy.Rate(10.0)        #10 second buffer for tf transformations
    while not rospy.is_shutdown():
        br.sendTransform((0.0, 0.0, 0.0),           #x,y,z linear transform
                         (0.0, 0.0, 0.0, 1.0),      #x,y,z,w quaternion
                         rospy.Time.now(),
                         "base_link",                  #child
                         "odom")                 #parent
        rate.sleep()

And here is the code for the laser link:

#! /usr/bin/env python
import roslib
roslib.load_manifest('tf_custom')

import rospy
import tf

if __name__ == '__main__':
    rospy.init_node('urg_tf')
    br = tf.TransformBroadcaster()
    rate = rospy.Rate(10.0)        #10 second buffer for tf transformations
    while not rospy.is_shutdown():
        br.sendTransform((0.0, 0.0, 0.0),           #x,y,z linear transform
                         (0.0, 0.0, 0.0, 1.0),      #x,y,z,w quaternion
                         rospy.Time.now(),
                         "laser",                  #child
                         "base_link")                 #parent
        rate.sleep()

Here is the output from running rosnode list:

/base_controller_spawner /diagnostic_aggregator /ekf_localization /husky_node /joy_teleop/joy_node /joy_teleop/teleop_twist_joy /move_base /odom_broadcaster /robot_state_publisher /rosout /slam_gmapping /twist_marker_server /twist_mux /urg_broadcaster /urg_node

I also took a log of using "rosrun tf tf_echo frame1 frame2" between the map and the base_link/laser, and the transform data appears to be updating when I move the robot. I haven't been able to find any other issues similar to this as of yet, so any kind help would be greatly appreciated.

Thanks in advance!


Originally posted by gannondorf on ROS Answers with karma: 16 on 2021-01-07

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I've managed to fix the problem. Running roswtf showed me that the ekf_localization node actually handles the odom->base_link connection. When I was created my tf tree initially, it had both the laser and the odom unlinked for some reason, so I assumed that I needed to create both. Removing my odom->base_link fixed the issue and maps appear as expected.


Originally posted by gannondorf with karma: 16 on 2021-01-07

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.