Hello world, after a long break, I started posting again!
Today I will share my experience building a project from Hackster called Mikrik.
Introduction storyAs a development engineer at Intel, I'm involved into a development of the Robotics SDK software aimed to boost development of the AMR(Autonomous Mobile Robots) robots in logistics, last-mile delivery and industrial automatisation service fields. I say our Robotics SDK product is a Robotics OS for robot OEMs manufacturers. This robust solution upgrades mobile robots with the most cutting-edge, industrial-grade functionality available at Intel.
Robotics SDK equips AMR robots with essential autonomy skills for precise localization and navigation, complemented by an advanced set of ITS Path Planned Navigation Plugins. It works using Intel-proprietary algorithms and products like ADBSCAN, CollabSLAM. These products facilitate seamless and autonomous operation.
Modular and configurable Robotics SDK components are distributed using debian packages. Robotics SDK allows to select the Intel-designed modules along with third-party component. They all can be aligned with your specific requirements. Robotics SDK is compatible with a wide range of x86 hardware, LiDAR sensors, 3D cameras. It has a wide range of tutorial applications to ramp-up with the Robotics SDK.
You might be even interested to run our Robotics SDK on the real robot by visiting that link. By default, we have tutorials tested on a ~2k$ robot like AAEON Robot Kit, or iRobot Dev Kit, or 15k$ Jackal Robot. Also you can run our tutorials using ROS-bags.
I believe, for the first time, better to use cheap robot if that is possible. That is why Mikrik robot is an ideal solution for that.
Mikrik Robot Source ProjectAs a developer I was amazed seeing that someone on Hackster did a great job to promote a Robotics SDK. I'm talking about Mikrik Robot Hackster Project.
It is a very detailed, and jaw-dropping article to read. Amazing job, after reading that article, I even bought one robot from a maker to support his activity.
I was able replicate the project 100%, and decided to bring my contribution into it. I'm using Mikrik robot as a reference design robot to test Robotics SDK functionality.
Now the story begins. Good luck!
Cost-cut IdeasLet's talk about on how you can save a dollar. Some of the components if you buy new are really expensive for an ordinary maker.
- A second-hand Realsense camera on Ebay ~100$. It can be D415, D430, D435 or D435i, and so on.
- An old NUC costs on Ebay ~35$-100$. Let's assume 50$.
Price for x86 Intel kit NUC+camera part ~150$.
Continue with the robot chassis components.
The rest will be Raspberry, motor driver, chassis, and batteries with gamepad (PS4 gamepad can be second hand one).
- Raspberry can be 4B or 3B. I see on Ebay some of the pre-owned 3B models are for 30$. Let's assume for Raspberry you will pay ~30$.
- DFRobot HAT Motor Driver for Raspberry Pi ~15$.
- x2 Motors from DFRobot ~15$
- x2 Wheels from DFRobot ~3$
- Chassis, it is a DIY, let it be ~30$
- Battery 2S Li-Po on Ebay ~35$
- Battery 3S Li-Po on Ebay ~40$
- Pre-owned Li-Po charger on Ebay Traxxas ID ~40$
- Pre-owned PS4 gamepad on Ebay 20$
- Misc staff let's put 20$
Price for Mikrik robot part ~250$
Total price of the full setup
Full ready-to-run robot 150$+250$=400$.
~280$ without batteries and charger.
You can cut costs by purchasing different Li-Po batteries, and charger. Traxxas brand Li-Po batteries and charger take a lot of budget, even a pre-owned options.
Part 1 Build Your Own Version Of The Mikrik RobotFollow the Tutorial by mxlfrbt to build and setup a robot MIKRIK. My own version robot works fine!
Step 1.1 Replicate Mikrik RobotFollow the original guide, and build a Mikrik robot. Remember some components you can buy pre-owned. During the build you can update chassis CAD files as described in the Step 1.2 below.
You can replace the LattePanda Delta 3 computer with an old NUC. NUC costs on Ebay 35$-100$. Same time, Lattepanda or another x86 board can run Robotics SDK software seamlessly.
Step 1.2 Chassis CAD UpdateI updated bottom chassis, top chassis, motor mounts, standoffs, and added castor shim to elevate a third wheel. For all updated CAD files I created a PR that is already got merged.
Clone the repo mikrik-robot-cad
cd ~
git clone https://github.com/mxlfrbt/mikrik-robot-cad.git
Replaced parts list:
Steps numeration are taken from the host project. During the build process of the original tutorial you have to:
- Replace Motor_Side_1.STL with Motor_Side_1_i_motors_fit.STL build Step 1.1
- Replace55mm_Standoff.STL replace with 55mm_Standoff_with_motor_channel.STL. Replace Bottom_Plate_1.STL with Bottom_Plate_1_i_motors_fit.STL. Host project build Step 1.3
- Add Caster_Ball_Shim_6mm.STL 3D-printed part on the caster ball installation Step 1.2
- Replace Top_Plate_1.STL with Top_Plate_1_intel_nuc_holes_only.STLStep 1.5
Instead of L-shape motors from the initial design I was using I-shape DFRobot motors and bigger 80mm diameter wheels.
I was using different motors to install Raspberry inside the chassis, and not on the top of chassis. This way I saved space and made robot look more unite.
Before you install wheels on the motors axle, put a 3D-printed shim Motor_shim_3mm.STL on the motors axle. It will prevent wheel from scratching chassis plates.
Step 1.4 Wiring updateTo power your NUC you need to take a 3S TRX charger wire and connect it to the DC power jack connector plug 5.5 x 2.5 using a screw terminal. Link I provided has a TRX wire with Banana ends, just cut Banana ends, strip wires and connect to the DC jack screw terminal.
Now I will share steps to make VSLAM work in three modes: mapping, localisation, and localisation with navigation.
Unfortunately, the official creator of the Mikrik project was not able to deal with CollabSLAM settings, and settled down the setup properly.
There is no wonder why he wasn't able to finish, our official Robotics SDK tutorials are not showing explicitly the detailed steps on how to do that, my tutorial is intended to fix that.
Change Default Realsense NamespaceRemove unnecessary namespace 'camera'. Open with sudo file:
sudo vi /opt/ros/humble/share/realsense2_camera/launch/rs_launch.py
Delete default value 'camera' of the camera_namespace. Line below change from:
{'name': 'camera_namespace', 'default': 'camera', 'description': 'namespace for camera'}
to
{'name': 'camera_namespace', 'default': '', 'description': 'namespace for camera'}
Part 2 Mapping Mode using Robotics SDKClone the repoFirst, take updated by me scripts from the repo mikrik-robotics-sdk. PR with the files to use below.
Clone the repo mikrik-robotics-sdk
cd ~
git clone https://github.com/mxlfrbt/mikrik-robotics-sdk.git
Step 2.1 Mapping Mode IntroductionBefore launch Mapping and Localization you need to change files in the default Robotics SDK installation folder.
Note: If you already can do mapping by following Step 4.4 of the original tutorial, then go to the localization section Step 2.2 below.
In my setup I decided to make Mapping mode work the same way as localization script I've made.
No obscure scripts laying in the source directory. Probably, localization based on the map created with collab_slam_nav.launch.py process will works too. But I didn't test that. Maybe owner of the project can try it out.
I strongly recommend to reproduce my setup 100%, to make it a full and completed.
Step 2.2 Mapping Mode SetupCollab Visual SLAM mapping is done using two ROS2 nodes: univloc_tracker and univloc_server, each of them has a separate launch file. Please, read more about Collab SLAM on the Robotics SDK page here.
First, clone my repo, if you didn't do it earlier:
cd ~
git clone https://github.com/maxxlife/mikrik-robotics-sdk.git
Make a copy of the Univloc Tracker Launch file:
sudo cp /opt/ros/humble/share/univloc_tracker/launch/tracker.launch.py /opt/ros/humble/share/univloc_tracker/launch/tracker_mikrik.launch.py
Open newly created file with sudo:
sudo vi /opt/ros/humble/share/univloc_tracker/launch/tracker_mikrik.launch.py
In L21 replace string:
configFilePath = os.path.join(get_package_share_directory('univloc_tracker'),'config','tracker.yaml')
with the string that leads to the new config file in a folder cloned from my Github repo:
configFilePath = '/home/<your-system-path-here>/mikrik-robotics-sdk/tracker_configs/mikrik_tracker.yaml'
Tracker file is ready. Make sure that path <your-system-path-here>
to the config file mikrik_tracker.yaml is the correct one.
Now you have to edit Univloc Server launch file.
Make a copy of the file:
sudo cp /opt/ros/humble/share/univloc_server/launch/server.launch.py /opt/ros/humble/share/univloc_server/launch/server_mikrik.launch.py
Open server file again with sudo:
sudo vi /opt/ros/humble/share/univloc_server/launch/server_mikrik.launch.py
Replace in a newly created file L104 from:
rviz_config = os.path.join(get_package_share_directory('univloc_server'), 'config', 'rviz2_server.rviz')
with:
rviz_config = '/home/<your-system-path-here>/mikrik-robotics-sdk/rviz_configs/mikrik_server_localise_and_nav2.rviz'
Now you can launch MappingMode!
Step 2.3 Mapping Mode LaunchLaunch it by running bridge first.
Note: Make sure that inside the script path to sourced files is the correct one.
cd ~/mikrik-robotics-sdk/scripts/
sudo chmod u+x bridge_launch.sh
./bridge_launch.sh
Make script executable:
cd ~/mikrik-robotics-sdk/scripts/
sudo chmod u+x rs-cslam-mapping.sh
Launch Mapping Mode:
cd ~/mikrik-robotics-sdk/scripts/
./rs-cslam-mapping.sh
You will see an rviz window.
Note: Put a tick on Map checkbox, to see a 2D generation in rviz! By default, it is turned off.
Now you can drive robot around and generate map.
Mapping Mode VideoBy default map will be saved into the /tmp/ folder.
Part 3 Localization ModeLocalization uses the same tracker file, but a different configuration file. I created a copy of the tracker file with a mark "loc" meaning "localization". It will contain a path to the different tracker config file, to make it work in localization mode.
Step 3.1 Localization Mode SetupCreate a copy of the tracker file again:
sudo cp /opt/ros/humble/share/univloc_tracker/launch/tracker_mikrik.launch.py /opt/ros/humble/share/univloc_tracker/launch/tracker_mikrik_loc.launch.py
Open tracker_mikrik_loc.launch.py
file with sudo:
sudo vi /opt/ros/humble/share/univloc_tracker/launch/tracker_mikrik_loc.launch.py
In L21 replace string:
configFilePath = '/home/flex-robot/mikrik-robotics-sdk/tracker_configs/mikrik_tracker.yaml'
with the string that leads to the new config file:
configFilePath = '/home/flex-robot/mikrik-robotics-sdk/tracker_configs/mikrik_tracker_localization.yaml'
Step 3.2 Localization Mode LaunchNotes: Make sure script contains correct path to all files. Assuming that ROS1-ROS2 bridge is already running.
Make script executable:
cd ~/mikrik-robotics-sdk/scripts/
sudo chmod u+x rs-cslam-localization.sh
Launch Localization Mode:
cd ~/mikrik-robotics-sdk/scripts/
./rs-cslam-localization.sh
After you launched localization mode, very important to check that your rviz opened correctly. Map created during the Mapping Step must be loaded, and visible in rviz, you must see moving TF-tree of the robot.
Make sure that rviz title name on the top of window shows the path to the config file mikrik_server_localise_and_nav2. If it is not, then double check that path to the rviz config file is a correct in file
/opt/ros/humble/share/univloc_tracker/launch/tracker_mikrik_loc.launch.py
You no need to close rviz window, proceed with navigation node setup.
Localization Mode VideoPart 4 Navigation ModeNow you can get navigating on the map.
Step 4.1 Navigation SetupCreate a copy of the default nav2 launch file:
sudo cp /opt/ros/humble/share/nav2_bringup/launch/navigation_launch.py /opt/ros/humble/share/nav2_bringup/launch/mikrik_cslam_nav2_launch.py
Add two remappings.
Open with sudo launch file:
sudo vi /opt/ros/humble/share/nav2_bringup/launch/mikrik_cslam_nav2_launch.py
Add two remapping into section in L57:
Instead of:
remappings = [('/tf', 'tf'),
('/tf_static', 'tf_static')]
Add remappings:
remappings = [('/tf', 'tf'),
('/tf_static', 'tf_static'),
('/cmd_vel', '/mobile_mikrik/cmd_vel'),
('/map', '/univloc_server/map')]
Save file.
Change inside navigation script file rs-cslam-navigation.sh, absolute path to the nav2 config file relevant to your file name. I specially marked them like "<your-system-path-here>"
cd ~/mikrik-robotics-sdk/scripts/
vi rs-cslam-navigation.sh
Change in line L4 path to the config file
params_file:=<your-system-path-here>/mikrik-robotics-sdk/nav2_configs/mikrik_nav2.param.yaml
Now you can launch Navigation node!
Step 4.2 Navigation Mode LaunchNote: Assuming that brindge, and Localization nodes are running.
Make script executable:
cd ~/mikrik-robotics-sdk/scripts/
sudo chmod u+x rs-cslam-navigation.sh
Launch it by running
cd ~/mikrik-robotics-sdk/scripts/
./rs-cslam-navigation.sh
If everything is correct, you will see that localization rviz window got updated with a costmap on it.
For now, that is all what I wanted to share with you.
Todo list:
- Add Wandering App to make robot autonomously navigate around the room and build map. Wandering App already exists in our Robotics SDK Tutorials, but it is optimized for AAEON Robot Kit. It just needs some easy remappings, to make it work. Will implement Wandering app feature in the coming weeks.
- Radxa X4 Intel N100 support. Run Robotics SDK VSLAM application on N100 Intel chip.
- Radxa X4 GPIO support. Switch from Raspberry Pi ROS1 GPIO readings fully to the Radxa X4 GPIO. It will require to rework existing Mikrik ROS1 source code for Raspberry Pi4.
Thank you for attention, bye!
Comments