# Magni move base, does it work properly?

**URL:** <https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849>\
**Category:** General Questions\
**Created:** [July 15, 2021, 1:58am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849 "2021-07-15T01:58:34Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [July 15, 2021, 1:58am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/1 "2021-07-15T01:58:34Z")

</div>

Hi Ubiquityrobotics, All,

I’m trying to use move base (path planners) with Magni in a Gazebo enviroment,

first question is are the parameters tweaked to optimal? (below, say for global costmap, local costmap and common costmap, they seem to be different from default values inside and not sure how you came up with them…)

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/f9fa86212cb94d14634afe42c6485c219159b4c4.png)

Reason I ask is when I launch the move base node with the parameters above, Magni does not move at all when I send a 2D nav Goal (and yes I had done localization already with AMCL and the laser seems correctly boucing off the walls…) but it wont just move at all, and errors below, Magni just stuck there,

I switched on recovery\_behaviour\_enabled: true in the move base and that didnt help either…,

Please assist

Tried both navfn and carrot planner and that didnt help as well…, got frustrated,

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/740ec00621c51c37b04b7bc768cb8f086f3f1510.jpeg)

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/347a7f788657965c752bd9b741e3ee33eefb6599.png)

---

<div class="post-metadata">

**Author:** ![IngeniousDoc](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/i/94ad74/32.png) [@IngeniousDoc](https://forum.ubiquityrobotics.com/u/IngeniousDoc)\
**Post date:** [July 15, 2021, 10:08am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/2 "2021-07-15T10:08:00Z")

</div>

Okay, so i am not part of the magni people, but my guess would be that maybe you can adjust the cost value in the code.

If I understood correctly, it seems like that the cost value is not allowing the magni to make a decision on adjusting itself. So, give it a shot at adjusting the code ands see what happens? Or maybe spawn the magni somewhere else

---

<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:** [July 15, 2021, 10:38am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/3 "2021-07-15T10:38:00Z")

</div>

It looks like it’s registering a potential collision there. If I recall right there’s some kind of bug in gazebo where the lidar would detect parts of the robot despite them not being in line of sight at all. Have you tried using laser filters with a box filter to remove scan points that hit the robot? That might do it.

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [July 15, 2021, 10:40am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/4 "2021-07-15T10:40:08Z")

</div>

ok, that kind of make sense, when you mention the cost value, do you mean adjusting the cost scaling parameter below for the global cost map and local cost map?

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/60bb28404dba288d620e4fc1810454472685aab2.png)

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [July 16, 2021, 6:49am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/5 "2021-07-16T06:49:17Z")

</div>

Hi All, Ubiquity Robot,

Ok I got further since I haven’t got any replies to my previous question,

I loaded a few simple obstacles from Magni to navigate around ,

First set of planners I used are:

1. base\_global\_planner \> navfn/NavfnROS

2. base\_local\_planner \> dwa\_local\_planner/DWAPlannerROS

and it does avoid the obstacle and goes around it which is great but but… …when everytime i send a 2D nav goal to it …, it thinks for like 30 seconds before it can figure out a path to go … why is that please? and what parameter I need to adjust here? I’m lost now…,

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/cf986645990cc9770473b648ef5dc4d681c2f26c.png)

Second set of planners I used (which is by defaults for the local planner) are:

1. base\_global\_planner \> navfn/NavfnROS
2. base\_local\_planner \> TrajectoryPlannerROS

It responded faster with this set of planners , however as you can see below, Magni just crashes to the obstacle , it tries to rotate recovery several times but fails…,

I would of thouht that TrajectoryPlannerROS would work better but it just hits the obstacle…,

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/0af787b2522a7f6422641c737ce5d2e0331fd09f.jpeg)

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/5b3e83c64d693487d04c7104cb0b389dd07cf132.jpeg)

I would appreciate if you can let me know what I’m doing wrong here…? or parameters I need to adjust etc…,

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [July 27, 2021, 4:07am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/6 "2021-07-27T04:07:48Z")

</div>

Hi All,

Can I please get a respond on this issue I’m having ??

Besides simulation on gazebo with Magni, I tried in real life today and done map\_runner first in Magni\_lidar and then roslaunch magni\_nav move\_base.launch (with nothing modified)…

And I keep getting these errors below ? please advice me on how to resolve this frustration…I couldnt use it at all…,

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/07c160c866b74159844c5ff0571a9e9e1194ebd4.jpeg)  
 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/0d5177d481912762966795fa50975dde385da04b.jpeg)  
 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/191e53492d11a91e98f660f97eab41bb2da87123.jpeg)

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [April 18, 2022, 6:37am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/7 "2022-04-18T06:37:35Z")

</div>

Hi @All,

I had made some progress since my last post here with move base,

it seems to be working now on navigating from point A to B, but it seems that it did not take the “Sonars” into account for sudden appearing obstacles, it will just run straight into it, but with move\_basic, it detects obstacles with the sonars and stops, what do I need to add to the move base params.yaml or move\_base.launch in order to activate the sonar detections (same as move\_basic)?

or atleast tell me which file should I be looking at to add sonar detections? (am lost at the moment…)

by the way, I can see the sonars active in RVIZ and rostopic echo /sonars (returned datas), but not stopping when there are obstacles in front …(eg…a person standing in the way), during navigation from A to B.

Thanks

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [April 24, 2022, 1:48am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/8 "2022-04-24T01:48:56Z")

</div>

any replies please???

---

<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:** [April 25, 2022, 6:37pm UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/9 "2022-04-25T18:37:23Z")

</div>

Yeah move\_base isn’t really designed to work with sonars, in fact it doesn’t work at all without a map, for which you’d need a lidar anyway. And if you’ve got a lidar for mapping, then it makes sense to use it for collision avoidance too, since it’s far more reliable.

I think the issue here may instead be that the local planner is not avoiding obstacles properly in general. Possibly due to a misconfig of the robot shape or something similar. I think DWA doesn’t work very well with the magni by default, but TEB performs a bit better.

@emptyslacker might know more.

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [April 30, 2022, 1:46pm UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/10 "2022-04-30T13:46:48Z")

</div>

@MoffKalast …I dont get it…what works with Sonars then? only move basic?

yes I use a lidar but it does not do any collision avoidance (it avoids the walls and that) but not me infront of it, it will just crash into me,

TEB planner is not even installed by default in magni, I had to install it myself and after testing with TEB, it’s like its on steroids…, it goes really fast from A to B and rotate recovery keeps failing (may be because Magni is not round?) but in terms of accuracy, I think it’s better than DWA…but still sudden obstacle avoidance did not work…, please advise? thanks, awaiting your reply,

---

<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:** [April 30, 2022, 8:20pm UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/11 "2022-04-30T20:20:00Z")

</div>

> [@inmoov](#):
>
> what works with Sonars then? only move basic?

Yes, in their raw form at least. It is also possible to convert the sonar data into a laserscan or pointcloud, which can then be used by navigation. Or something like the [range\_sensor\_layer](http://wiki.ros.org/action/fullsearch/range_sensor_layer?action=fullsearch&context=180&value=linkto%3A%22range_sensor_layer%22) which integrates them into the costmap of move\_base.

> [@inmoov](#):
>
> it goes really fast from A to B and rotate recovery keeps failing

Are you sure the configuration is correct on that? TEB has I think something like 3 or 4 config files that need to be adjusted to fit the robot. One of them should have a definition for the robot shape and size, which is likely too small given that it’s not stopping soon enough.

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [May 1, 2022, 3:14am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/12 "2022-05-01T03:14:08Z")

</div>

@MoffKalast ,

ok, in that case, I had integrated something like that in the costmap of move base, below:  
are you referring to the obstacle layer? (I have included the laser scan and sonar scan sensor),

topic is /sonars , is that not right?

obstacle\_layer:  
enabled: true  
max\_obstacle\_height: 0.6  
min\_obstacle\_height: 0.0  
origin\_z: 0.0  
z\_resolution: 0.2  
z\_voxels: 10  
unknown\_threshold: 15  
mark\_threshold: 0  
combination\_method: 1  
track\_unknown\_space: true  
obstacle\_range: 5.5  
raytrace\_range: 6.0  
inflation\_radius: 0.10  
observation\_sources: laser\_scan\_sensor sonar\_scan\_sensor  
publish\_voxel\_map: true

sonar\_scan\_sensor:  
data\_type: PointCloud2  
topic: /sonars  
marking: true  
clearing: true  
min\_obstacle\_height: 0.0  
max\_obstacle\_height: 0.3  
observation\_persistence: 0.0

or are you referring to the local and global costmap which I need to add a layer in the plugins (at the bottom)?

plugins:

- {name: static\_layer, type: “costmap\_2d::StaticLayer”}
- {name: obstacle\_layer, type: “costmap\_2d::VoxelLayer”}
- {name: inflation\_layer, type: “costmap\_2d::InflationLayer”}
- {name: sonar, type: “range\_sensor\_layer::RangeSensorLayer”}

I did and I got this error when loading:

 ![image](https://frm.ubiquityrobotics.com/uploads/default/original/1X/01f145c09886a17484ab06fe2641e185cba748f5.png)

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [May 5, 2022, 4:31am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/13 "2022-05-05T04:31:44Z")

</div>

any response on this please?

---

<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:** [May 7, 2022, 5:56am UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/14 "2022-05-07T05:56:28Z")

</div>

Sorry, I don’t know Move base well enough to comment. It is a very involved nav stack and requires a lot of messing around to get it’s great many parameters sorted out, that I know.

---

<div class="post-metadata">

**Author:** ![inmoov](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/inmoov/32/473_2.png) [@inmoov](https://forum.ubiquityrobotics.com/u/inmoov)\
**Post date:** [July 2, 2022, 1:30pm UTC](https://forum.ubiquityrobotics.com/t/magni-move-base-does-it-work-properly/849/15 "2022-07-02T13:30:55Z")

</div>

well, I have worked out without the need of sonars, just using the laser to avoid sudden appearing objects.
