Hey,
after finally getting deeper into ROS and understanding most of the things which are necessary for using the Gmapping-SLAM ( basics like tf, odom etc ) im now at the point of testing the whole thing. There is the Problem that Gmapping stops updating the map after serval scans. But first of all i want to give you a short overview:
**What i want to do:** Im trying to use a simulated 2D-Scanner in VREP as source for Gmapping.
**Systemconfig:** I use Groovy on a Ubuntu 12.04 LTS on a old IBM X41 Laptop (1.5Ghz Centrino SinglecoreCPU)
**Progress:**
1. I transfered the /scan and /odom-Topic from VREP to ROS.
2. I wrote some code (odom_baselink_tf.py) for tf of /base_link to /odom:
> def metadata_odom(data):> global p, q, info> info = data> p = data.pose.pose.position> q = data.pose.pose.orientation> rospy.loginfo(Received odom)> ...> broadcaster.sendTransform(> (p.x, p.y, 0), > (q.x, q.y, q.z, q.w),> rosnow,> base_lin,> odom> )
3 . I use a static tf transform between base_link and LaserScanner_Frame: `rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link LaserScanner_Frame 100
`
This results in the following tf-tree:

I use Gmapping with the following Settings:
But if i use these settings, there is the problem that Gmapping stops updating the map after serval scans. If i look at the SLAM-Debug-Messages there are serval odd messages:
update frame 7
update ld=0.0495583 ad=0.179583
Laser Pose= 13.7771 3.96148 -0.695156
m_count 7
[DEBUG] [1403512083.321312113]: TF operating on not fully resolved frame id base_link, resolving using local prefix
[DEBUG] [1403512083.321624443]: TF operating on not fully resolved frame id odom, resolving using local prefix
Average Scan Matching Score=164.656
neff= 49.8545
Registering Scans:Done
[DEBUG] [1403512083.931338640]: scan processed
[DEBUG] [1403512083.933940439]: new best pose: 13.752 3.943 -0.644
[DEBUG] [1403512083.935263651]: odom pose: 13.777 3.961 -0.695
[DEBUG] [1403512083.936265942]: correction: -0.025 -0.018 0.051
[DEBUG] [1403512083.937573997]: Trajectory tree:
[DEBUG] [1403512083.938640263]: 13.752 3.943 -0.644
[DEBUG] [1403512084.006696687]: 13.513 4.059 -0.069
[DEBUG] [1403512084.010663464]: Reading is NULL
[DEBUG] [1403512085.983524674]: TF operating on not fully resolved frame id base_link, resolving using local prefix
[DEBUG] [1403512085.985853674]: TF operating on not fully resolved frame id odom, resolving using local prefix
[DEBUG] [1403512087.105476077]: Updated the map
[DEBUG] [1403512087.117026498]: MessageFilter [target=/odom ]: Added message in frame /LaserScanner_Frame at time 1403512075.593, count now 1
[DEBUG] [1403512087.118606658]: MessageFilter [target=/odom ]: Discarding Message, in frame /LaserScanner_Frame, Out of the back of Cache Time(stamp: 1403512072.685 + cache_length: 10.000 < latest_transform_time 1403512085.969. Message Count now: 1
[DEBUG] [1403512087.120816298]: MessageFilter [target=/odom ]: Added message in frame /LaserScanner_Frame at time 1403512078.106, count now 1
[DEBUG] [1403512087.121834794]: MessageFilter [target=/odom ]: Message ready in frame /LaserScanner_Frame at time 1403512080.746, count now 1
[DEBUG] [1403512087.122950160]: TF operating on not fully resolved frame id odom, resolving using local prefix
[DEBUG] [1403512087.126866647]: MessageFilter [target=/odom ]: Added message in frame /LaserScanner_Frame at time 1403512080.746, count now 1
[DEBUG] [1403512087.128059466]: Time jumped forward by [5.379792] for timer of period [0.010000], resetting timer (current=1403512087.128015, next_expected=1403512081.748223)
The messages show the last Map-Update (#7). There are also some "`TF operating on not fully resolved frame id` "-Messages which i dont understand, because i got all transformations in my tf tree. These messages occur as i start gmapping. What should i do against them? I think they are resulting in my problem.
Or maybe the processingpower of my old laptop is the problem? Top says its always 100%.
Does someone got a idea whats wrong with my setup? Any additional graphics needed to understand the whole thing?
EDIT:
Okey, is it right that the tf-Rate of my `/odom_baselink_tf.py` script needs to be higher, as the buffer is about 10s and the rate of the script is below 1Hz ? Could i reduce slam-tf-rates, as i cant increase the odom publish-rate of the VREP-Simulator ? Or i am complety wrong?
Additionally i switched over to a x200 Laptop with a Core2duo. This way i got a publish rate of about 3 Hz for odom via VREP.
EDIT2:
I found the `transform_publish_period`-Gmapping-parameter and set it to 10Hz. Additionally i changed my pythonscript to publish tf at 10Hz. Every tf in my tree uses now 10Hz for publishing. But the map still dont update.
Cheers
Julian
↧