MaverickPeter / MR_SLAM

[IEEE T-RO 2023] A modularized multi-robot SLAM system with elevation mapping and a costmap converter for easy navigation. Different odometry and loop closure algorithms can be easily integrated into the system.
MIT License
281 stars 20 forks source link

What is the unit of angle of phase_corr in disco_ros, is it degree(0-360) ? #3

Closed Woodpecker0 closed 1 year ago

Woodpecker0 commented 1 year ago

In disco_ros/main.py ` yawpc, = phase_corr(DiSCO_candidate, DiSCO_current, device, corr2soft)

    if yaw_pc < cfg.num_sector//2:
        yaw_pc = (cfg.num_sector//2 - yaw_pc) / float(cfg.num_sector) * 360.
    else:
        yaw_pc = (yaw_pc - cfg.num_sector//2) / float(cfg.num_sector) * 360.

` It's seems degree. However, It's not same in euler2rot(), which is radians. If it's a bug, how can this loop detection work with this initial pose?

MaverickPeter commented 1 year ago

Hi @Woodpecker0, thank you for your thorough consideration. I believe there is a bug here, which I will fix as soon as possible. The system code has been rewritten from our experimental version; we are presently undergoing code review. Thank you once more for your attention to detail.

Woodpecker0 commented 1 year ago

Thanks for your reply.

What's more, I also found that the yaw_pc always be 32. yaw_pc, _ = phase_corr(DiSCO_candidate, DiSCO_current, device, corr2soft) print("yaw_pc:", yaw_pc)

MaverickPeter commented 1 year ago

@Woodpecker0 Thanks for your carefulness! I used the place descriptor to calculate the yaw, so the initial guess is wrong. I have fixed this bug using the Fourier spectrum and tested it. Thanks again for improving the code!

Woodpecker0 commented 1 year ago

the loop detection is good when i apply you improvement ! I found a small bug later. it seems that the yaw_pc will never be negative or larger then 180, is it correct? ` if yaw_pc < cfg.num_sector//2: yaw_pc = (cfg.num_sector//2 - yaw_pc) / float(cfg.num_sector) 360. else: yaw_pc = (yaw_pc - cfg.num_sector//2) / float(cfg.num_sector) 360.

`

MaverickPeter commented 1 year ago

@Woodpecker0  That's really an embarrassing bug. I'm sorry for making this mistake. It should be only one line here: 'yaw_pc = (yaw_pc - cfg.num_sector//2) / float(cfg.num_sector) * 360'