Moorebot Scout – As Linux as it can get!

Recently I got myself a new toy, the Moorebot Scout

The Moorebot Scout startet out with a Kickstarter campaign but by now the Scout is also available for retail directly from Moorebot or from some of the more usual outlets. I got mine from a German retailer via eBay. The Scout is a little larger than the palm of your hand and probably weighs about 350 grams. The overall appearance is not made to be cute like the Anki robots Cozmo or Vector, it lacks a screen for facial expressions and also the Mecanum wheels give the Scout a more, let’s say, “utility” look. Mecanum wheels are pretty cool since they allow the robot to move in any direction depending on the orientation of the wheel movement, a very clever design! You can move forward and backward, turn left and right, but most awesome and amazing is the crab like straight left and right movement!

The Datasheet

The technical details are also nice, but nothing really out of the ordinary. The usual “6 DoF IMU”, which in fact is a 3 axis accellerometer and a 3 axis gyroscope, a LSM6DS3 by ST Microelectronics. Something pretty much every phone has these days, so you know what to expect (for a future version I would recommend the LSM9DS1 then you also get a 3 axis magnetometer (aka compass) in one chip package). A little more unusual is the TOF sensor, time of flight. This does not measure how long the Scout can stay in the air 🙂 It measures the time between sending out a light pulse and its returned reflection and from that calculates the distance to the reflecting object. This is actually pretty neat! The sensor used on the Scout is made by ST Microelectronics, a VL53L0X, and can measure absolute distances up to 2 meters. It is sitting on top of what looks like a screen, but is in fact the camera window. The camera has a maximum resolution of 1080p and has the nice feature that the infrared (IR) filter can be disabled to enable night vision which is even further helped by three pretty bright IR LEDs beneath the camera. To figure out the room’s light level in order to switch from day to night mode and back there is also a light sensor, a LITE-ON LTR-303. Then there is a speaker and a microphone, four LEDs on its back usually signalling battery or charging state, a power button and power LED on the one side and a WiFi mode switch with LEDs on the other side. Talking about battery, that’s also a big plus for the Scout, the power cell is a pretty standard LiPoly 18650 cell. So if the battery wears out it can be replaced, the Scout is also pretty accessible since it is screwed together, not glued.

The system is powered by a Rockchip ARM64 SOC (I have not yet figured out exactly which) accompanied by 1GB of LPDDR3 RAM and a 16GB eMMC. The CPU features four ARM A7 cores running at up to 1.2GHz. Also on board is 802.11a/b/g/n dual band WiFi – no ac though. There is probably also some Bluetooth in there but not active by default and I have also not yet figured out how to activate it.

The overall mechanical design is pretty nice, has a sturdy feel to it – except, well, the wheels and gear boxes. The little drums on the Mecanum wheels have a very noticeable tolerance of their shaft which makes them click-clack back and forth on it so overall movement gets this clicky background noise and also adds some wobble to it. The gearboxes between the wheels and the actual motors have a very noticeable slip of almost 20 degrees, i.e. if you change direction it may take the axle up to 20 degrees until the wheel actually starts to turn. This makes precise movements pretty much impossible.

Movement and Navigation

Thee Scout is meant to be controlled over an App (Android or iOS), you can live stream the camera picture, move it around, setup control paths it is supposed to then autonomously follow – which it usually fails. The problem is the navigation. How can you navigate a room? One way it to basically count steps – like two steps forward, turn left 90 degrees, 10 steps forward, turn right 45 degrees, and so on. But this only works if you can rely on the movements, that a step always moves by the same distance, that a 10 degree turn really turns by exactly 10 degrees etc. If any of that has a more or less great tolerance then you get lost very quickly. You can try this as a seeing person. Stand in the middle of a room and walk a pattern, memorizing steps and turns, returning to the starting position. Then turn of the lights and try to follow that path again, in the dark, only relying on your counted steps and turns. I would make a bet that you will not return to the starting point. Your steps and turns are not exact enough.

And that’s exactly the problem of Scout. Its traction system is so inaccurate that it can not be used to measure anything, so you can not record a movement like “move 10cm forward, turn 30 degrees left, move 20cm forward, …” – that does not work. And so the “Patrol” path function of the software is a cute toy but not useful at all. Sadly this can also not be overcome with the TOF sensor. I am not sure if this was the reason or something else but Moorebot recently announced the Scout-E which is basically the same hardware but the Mecanum wheels have been replaced with tracks. If this really helps?

Back to navigation. Since you can not rely on the traction system movement you can not reliably scan your surroundings with it to create some kind of a map either. Finally there is the camera… I think using the camera and some image recognition magic a reliable room navigation (not mapping) could be implemented, using landmarks. This is actually also how seeing humans navigate the world, we usually do not count steps or measure distances – from bed to kitchen and back. We look and try to find something in the picture we see that we recognize and if we find something that we know is in the direction we need to go then we can start to move towards it, eventually finding more such landmarks while we go and so move from one landmark to the next.

This type of simple landmark navigation should also be possible for the Scout. Instead of programming a path you would program a sequence of landmarks you would have to teach to the robot before first use. These landmarks can be contrast rich items in view or, kind of worst case, artificial 2D barcode style stickers.

BUT – all this is not why I am writing about the Scout! Most of this is pretty much secondary compared to:

The Inner Values

Over the past years I dug into several robots, I don’t know, it seems I have some love for them. The first was the Aldebaran Nao, then after a long pause I lost my heart first to the Anki Cozmo and then Vector. Anki did such an amazing job at making these cute little, else pretty useless, robots come to life! Their joyful sounds, the little non sense they are doing all the time, really really cute – almost as if they were alive!

But all of these had a big problem. Although all of them were based on a lot of open source and free software, only little of it, if at all, was accessible. The Anki Vector is basically running a trimmed down Android with Linux kernel on a Qualcom SOC. Sourcecode? Shell access? Nope. Nada.

And here the Scout really shines so bright, almost as bright as the sun! There is still some room for improvement but Moorebot got really very close.

So first thing to notice is that after setup, which is actually very reliable and easy, you can directly ssh into the Scout (the password is ‘linaro’):

$ ssh linaro@linaro-alip
linaro@linaro-alip's password: 
Linux linaro-alip 4.4.189 #1 SMP Wed May 10 02:01:01 UTC 2023 aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
linaro@linaro-alip:~$

How crazy cool is that!? So you see it is running some kind of oldish Linux kernel 4.4.189 and an ARM64 based system. By a little oversight (or intention?) it is also pretty easy to get full root access. The system already comes with sudo enabled but for some reason the sudo binary is not setuid-root. Luckily the local system init RC file is user writable, so editing /etc/rc.local and adding a single line plus a reboot enables sudo:

...
/sbin/insmod /usr/lib/aarch64-linux-gnu/motorfr.ko
/sbin/insmod /usr/lib/aarch64-linux-gnu/motorfr_old.ko
/sbin/insmod /usr/lib/aarch64-linux-gnu/motorfl_old.ko

chmod 4755 /usr/bin/sudo
exit 0

And after the reboot you can do this:

linaro@linaro-alip:~$ sudo su -
root:~#

Tadah! Next uber-cool thing is the system is based on Debian ARM!

$ cat /etc/debian_version 
9.11

And yes, everything’s there, apt and all. So this is already very very cool.

But hey, hmm… a robot? And Linux? I mean, there are GNOME or KDE which make Linux on the desktop, laptop or today even mobiles, but a robot? Oh yes, I hear you but do not despair, open source has you covered and the environment of choice for open source robotics is called ROS – Robot Operating System! Don’t get irritated by the term “operating system”, see it more as the robotics layer on top of a Linux kernel and the Debian (or many other) operating systems. The important point here is that the Scout is a very affordable very open source friendly robot platform for all kinds of development, learning and teaching! You get a bunch of sensors, a pretty cool yet inaccurate four wheel omnidirectional Mecanum drive, video + bidirectional audio and all that for under $200! This got me really excited!

On the Scout ROS is accompanied by OpenCV for image processing, another open source toolkit. Using OpenCV you can do things like pattern recognition and a lot more, I hope to be able to use it to implement something like my landmark navigation idea I described before.

Let the Fun Begin – Programming

The manufacturer app comes with some Scratch programming integrated. Pretty neat, nice for the kids, but well, also pretty limited. We want more, do we? ROS is pretty well documented and has pretty broad adoption. You can program ROS in C, C++, Python and a lot more, I’m sure. ROS is based on the concept of nodes and messages. Nodes can publish message and subscribe to message topics from other nodes. The super cool thing about this is that all of this also works over the network! So you can program a ROS node on your PC that subscribes to some nodes on your Scout robot and voilá, you get sensor data! Or you can publish messages to the node controlling the robot’s velocity and *meep* it moves!

The ROS version on the Scout is ROS-1, not the latest but fine. To program ROS in Python there is the ‘rospy’ Python module. On the Scout itself you have Python2 and Pythong3 installed but rospy is only available for Python2. On the PC side you can use Python3 and if you are using Debian like me you can install rospy easily:

sudo apt install python3-rospy

For rospy to connect to your robot you need to set an environment variable with the robot’s address:

export ROS_MASTER_URI=http://linaro-alip:11311

All of that is nothing Scout specific, this is how you would work with any other ROS robot. After that environment variable is set you can also use other ROS commandline tools on your host PC to interact with the Scout robot.

So, now you are set up for tinkering! A first small Python program could start like this:

#!/usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist

The ‘geometry’ message type is needed for the movements I am going to do next, but first we need to create a node and a message publisher:

rospy.init_node('robot_cleaner', anonymous=True)
velocity_publisher = rospy.Publisher('/cmd_vel', Twist, queue_size=10)

The node name does not matter, it just needs to be unique. The message publisher will publish messages to the ‘/cmd_vel’ node, the ‘command velocity’, so we will set a speed not a distance.

Next we need to construct such a geometry message to publish with a speed command:

vel_msg = Twist()

vel_msg.linear.x = leftright
vel_msg.linear.y = fwdrev
vel_msg.linear.z = 0.0
vel_msg.angular.x = 0.0
vel_msg.angular.y = 0.0
vel_msg.angular.z = rotate

velocity_publisher.publish(vel_msg)

The Scout has three degrees of freedom, linear forward and backward, linear sideways left and right and rotation to the left and right. Left/right is decided using the sign of the floating point number.

And that’s almost everything needed to make the Scout move! I have put a full Pyhton3 program on Github which lets you control the Scout from your PC using a PS/3 (or any other) joystick controller:
https://github.com/nica-f/Scout-Python-JS-Move
(Please be gentle, I am still new to Python and ROS so I might be doing some things pretty wrong here…)

And all of that can be programmed and run from your local PC or laptop, no need to compile anything or even transfer program files to the robot. That’s probably the most convenient but yet still full in control and in depth robot development experience you can possibly ask for!

You may say, well, Python is nice but also not very fast and if I want to do more sophisticated things especially involving OpenCV then you may want program using a compiled language like C or C++ and run native code directly on the robot. Well, also this is possible albeit with a bit more overhead. The necessary development stuff has been made public here: https://github.com/Pilot-Labs-Dev/Scout-open-source

Verdict, for now…

The Scout clearly lacks the cuteness of something like Cozmo or Vector. The mechanical issues with the wheels and gearboxes make it hard to move precisely. It lacks some more sensors for proper room navigation, but maybe this can be compensated for by clever software?

But the way the software is architected outweighs everything. It is so far the cleanest Linux based commercial robot I have seen, very accessible, great to explore ROS based robots with! So I would give it 9 out of 10 points for interested developers! And the price point at $179 is, for what you get, almost a bargain (compare that to the much less accessible Vector which now retails at $499 – over $300 for the cuteness?).

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert