# How to reset odom?

**URL:** <https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915>\
**Category:** General Questions\
**Created:** [November 15, 2021, 3:03am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915 "2021-11-15T03:03:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerry](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://forum.ubiquityrobotics.com/u/Jerry)\
**Post date:** [November 15, 2021, 3:03am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/1 "2021-11-15T03:03:31Z")

</div>

I am looking for solution to change map.  
However, one part of that may need to reset the odom without shut down the whole unit as:

sudo shutdown -h now

How to reset magni without restart the whole unit.  
Thanks,  
Jerry

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [November 15, 2021, 5:26am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/2 "2021-11-15T05:26:59Z")

</div>

Hello Jerry. Do you have a version 5.2 or later MCB board? If so and you have updated motor node then you have the pieces do do as you request but Im not sure I have an automated way to do that. There is a small black MCB reset switch and when pressed it is likely do do what you request although that was not it’s intent. See if it works. This is the only small pushbutton on the MCB and it is about 2cm below the place where the two large white connectors meet at the top of the board. The system detects a reset of the MCB (that is what that switch is) and in our current motor node as of several months back I then re-initialze the motor node.

---

<div class="post-metadata">

**Author:** ![Jerry](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://forum.ubiquityrobotics.com/u/Jerry)\
**Post date:** [November 15, 2021, 5:53am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/3 "2021-11-15T05:53:43Z")

</div>

Thanks for your prompt reply.

Actually, I want to have a way to reset the odom to zero position with software when there is a need of changing the map.

Is any way to achieve with software ?  
Thanks.  
Jerry

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [November 15, 2021, 7:07am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/4 "2021-11-15T07:07:13Z")

</div>

I figured as much. I have to look into this to answer that question, it has not come up before.  
I do want to point out that this is a very good thought and I try hard to respond to real needs that other people may someday want as well. Thanks for the feedback!

---

<div class="post-metadata">

**Author:** ![MoffKalast](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/moffkalast/32/214_2.png) [@MoffKalast](https://forum.ubiquityrobotics.com/u/MoffKalast)\
**Post date:** [November 15, 2021, 6:06pm UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/5 "2021-11-15T18:06:04Z")

</div>

Well it’s unclear if it’s possible to actually reset it as-is, but you could kill the ubiquity\_velocity\_controller and start it up again, that may do it. It’s usually spawned in the core.launch file in magni\_bringup.

---

<div class="post-metadata">

**Author:** ![Jerry](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://forum.ubiquityrobotics.com/u/Jerry)\
**Post date:** [November 16, 2021, 7:56am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/6 "2021-11-16T07:56:09Z")

</div>

if I just kill the node with:  
rosnode kill /motor\_node

## and start the node again, it results in following error.

# SUMMARY

PARAMETERS

- /frequency: 10.0
- /rosdistro: kinetic
- /rosversion: 1.12.17
- /use\_sime\_time: True

NODES  
/  
motor\_node (ubiquity\_motor/motor\_node)

ROS\_MASTER\_URI=[http://ubiquityrobot.local:11311](http://ubiquityrobot.local:11311)

## process[motor\_node-1]: started with pid [10953] _**[ERROR] [1637048395.491614910]: setting deadzone enable to 1**_ _**[ERROR] [1637048395.500375163]: GOT error from Firm 0x00**_

It do not start the motor node successfully. any advise ?  
Thanks and Best Regards,  
Jerry

---

<div class="post-metadata">

**Author:** ![MoffKalast](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/moffkalast/32/214_2.png) [@MoffKalast](https://forum.ubiquityrobotics.com/u/MoffKalast)\
**Post date:** [November 16, 2021, 10:24am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/7 "2021-11-16T10:24:18Z")

</div>

Note that I didn’t say motor node, but ubiquity\_velocity\_controller. The motor node isn’t what’s handling the odometry, it just sends commands to the MCB.

> <https://github.com/UbiquityRobotics/magni_robot/blob/4c43300e4fc08a37f5206c9db85a6e11105f91d6/magni_bringup/launch/core.launch#L106>

---

<div class="post-metadata">

**Author:** ![Jerry](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://forum.ubiquityrobotics.com/u/Jerry)\
**Post date:** [November 17, 2021, 2:24am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/8 "2021-11-17T02:24:31Z")

</div>

Thanks for your advice.

I tested as below:

rosrun controller\_manager controller\_manager kill ubiquity\_velocity\_controller

then start it again:

rosrun controller\_manager controller\_manager load ubiquity\_velocity\_controller

however, there is no /odom output I check also the /ubiquity\_velocity\_controller/odom.  
It do not have any output either.  
any advise?  
Thanks,  
Jerry

---

<div class="post-metadata">

**Author:** ![Jerry](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://forum.ubiquityrobotics.com/u/Jerry)\
**Post date:** [November 17, 2021, 2:43am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/9 "2021-11-17T02:43:17Z")

</div>

Sorry, I should use “spawn” instead of “load”:  
rosrun controller\_manager controller\_manager spawn ubiquity\_velocity\_controller

The topic /odom will stop when kill the “ubiquity\_velocity\_controller” and start again when spawn the “ubiquity\_velocity\_controller”.

However, the odom data do not reset to zero. It still contain the previous odom data.  
any advice ?

---

<div class="post-metadata">

**Author:** ![MoffKalast](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/moffkalast/32/214_2.png) [@MoffKalast](https://forum.ubiquityrobotics.com/u/MoffKalast)\
**Post date:** [November 17, 2021, 11:53pm UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/10 "2021-11-17T23:53:23Z")

</div>

Ah I thought that would do it, perhaps there’s some kind of working data stored on the MCB. I would try this one last thing if it does anything but I’m not hopeful:

- turn off motors with the switchboard
- kill motor node and velocity controller
- turn motors back on
- relaunch nodes

I think that still won’t completely reboot the MCB, but it may do something to help it reset. @mjstn2011 I suppose you might know?

Anyway if that doesn’t work then I’m really not sure where it could be stored. Another more elaborate option would be to remap the topic at the start, to something like /odom\_raw and then make a node that republishes it to /odom and can reset the data by subtracting the values recorded at the reset. Not sure how that would play with the tf frames though.

Perhaps a better question is: why does changing a map require resetting the odometry? Any standard ROS SLAM stack is fully capable of working with that initial offset without issues.

---

<div class="post-metadata">

**Author:** ![Jerry](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://forum.ubiquityrobotics.com/u/Jerry)\
**Post date:** [November 18, 2021, 12:59am UTC](https://forum.ubiquityrobotics.com/t/how-to-reset-odom/915/11 "2021-11-18T00:59:31Z")

</div>

Thanks for your advice.  
Will try to use software to resolve it as your comments.  
Thanks
