Showing posts with label Robot Games. Show all posts
Showing posts with label Robot Games. Show all posts

Sunday, March 16, 2025

PolyMap: Leveraging Godot for Visualization (#3)

 


Leveraging Godot for PolyMap Visualization

Introduction to PolyMap and Visualization Goals
PolyMap is my experimental platform exploring multi-agent, robotic swarm-based Simultaneous Localization and Mapping (SLAM) strategies for mapping real-world environments. Development has been incremental: starting with a simulation, robot agents, a mapping manager, and basic visualization. One key goal was to leverage existing technologies like game engines to rapidly create an operable system. Game engines also offer a natural interface to visualize the spatial data generated by the robots as they explore physical space—and it’s just really cool!


Why Godot?

Why use a game engine instead of existing tools like RViz? There’s no single answer. RViz and others are developed for the ROS environment and are reportedly easy to integrate with ROS, but I haven’t explored ROS yet. Possibly due to hardware constraints or concerns about getting locked into a specific architecture, I’ve chosen instead to learn the fundamentals of the (robot) science before adopting fully developed solutions. This is also exactly why I’m starting with a single ultrasonic sensor rather than a Lidar for spatial sensing. There is a vast amount of unbuilt software needed in this space, and I want to understand the basics before being embedded in one ecosystem. (A related question: is ROS becoming a walled garden?)

I chose Godot because it’s open source, has no license fees, and has a large community. It can render immersive 3D environments with advanced graphics and interactivity—features that would take far longer to build from scratch. This makes enhancements like zooming, panning, robot tracking, and detailed exploration straightforward. Overall, it’s a friendly platform for any maker stepping into games or 3D visualization. Plus, Thor from Pirate Software thinks "Godot is the Blender of game engines". 😉


Transitioning from Python to Godot
The original Python-based visualization tool was a solid proof-of-concept for displaying the global map and robot telemetry. As the project matured, I planned to try a game engine to overcome Python’s limitations in interactivity and feature expansion—where everything had to be built from scratch. 

Transitioning to Godot 4.4 opened new possibilities for a more fluid UI. Because PolyMap uses MQTT for distributed communication, multiple visualization clients can consume the same data. This architecture also means each component can be developed in the best language for its function: the simulation and map manager will stay in Python, while the robot agent code (currently Python) will move to C++ for real hardware deployment. 🤖

Here is a video showing the transition and new version:



Integrating MQTT Communications in Godot
A critical aspect of PolyMap is using MQTT for data exchange. Fortunately, people like Goatchurch paved the way by porting MQTT code into Godot. It was showcased at a Godot convention, and most importantly, their open-source work on GitHub allowed me to clone it. Within a short time, messages from my existing Python version appeared in Godot. Once the MQTT connections and message handling were in place, communications were solid, letting me focus on features and functionality.

In the prototype, there’s a connectivity dialog box where the user enters the server URL, port, user ID, and password. It also allows topic subscriptions and message publishing. In this setup, the visualization subscribes to global_map and telemetry topics. Currently, the entire 100×100 integer map is broadcast every second, alongside telemetry data from the robot agents.


Using Godot
One of the most exciting aspects of Godot is how easily you can configure screens and add new features. Godot is heavily object-oriented; everything is a Node with attributes and methods. It reminds me of early “thick client” GUI development (pre-Web, like Acius 4D). This is my first Godot project, so I’m still learning and deciding how much to configure in the editor versus coding in scripts. Right now, screen elements are configured in the editor, while global map rendering is done in code.

There is a learning curve to working with Godot, but I understand it is very similar to other game engines like Unity and Unreal engines. For me, it was natural to code with an AI (or two, or three) to help me quickly learn how Godot works. There are also good videos on YouTube as well such as this video. One issue I ran into was that many of the AIs did not know how Godot 4.4 had changed from earlier versions, there was a constant effort required to correct the AI when it was off hallucinating. 🙂

Building the first prototype had its challenges: positioning the camera to view the map, deciding where to place MQTT functions, and balancing performance between rendering each grid point individually or using a grid mesh. Once I got the hang of Godot, it was surprisingly simple to get the visualization working. Adding a mouse-wheel zoom took only five minutes. I’m excited to add more capabilities quickly!


Future Features
With the first iteration working, here’s what I’m planning next:

  • Persistent Map: I can choose between redrawing the global map each time, or making it more persistent and only updating changed elements as the are discovered by the robot.
  • Free Fly - Camera: I will change the primary camera and give the user the ability to 'free fly' over the map moving around the landscape discovered by the robots. 
  • Robot FPV: It should be possible to put a camera in each of the virtual robots, allowing the user to select the robot and view the 3D space from its perspective.

Looking ahead, I’m breaking out the map manager and robot agent code from the simulation, moving toward a distributed computing platform. This is a key step for migrating from simulation to real hardware. Stay tuned for more updates!

Sunday, December 23, 2018

Robot Arcade - LetsRobot.tv

I am creating a "Robot Arcade" on LetsRobot.tv as a holiday project!  You can visit the site LIVE here:


Robot Arcade - LetsRobot.tv
It is a work in progress, but works well to get all of the robot fantasy out of your head.  I am building this "robot" with mostly parts from recycled printers and some 3D printed parts.  It is using an L298N as the motor controller.  All driven by a Raspberry Pi that is streaming video and controls between it and the LetsRobot.tv servers. I will be using MQTT to pipe commands from the server to various computers controlling the scene.

In the first boot strap days, it was 'challenged' by the 'internet' robot operators.  my motors were not secured and were dancing around the scene.  Actually somewhat fun.  Today I put together this motor mount design and will be using it to build out the Arcade.

3D CAD designed to be a motor mount

I don't quite know what I will do with this yet, but I would like it to be some form of a remote robot - 'game of skill'.  it is fun to see some form of a battle or skill challenge performed by the remote operators.

I am open to suggestions for game ideas!  :)

Friday, November 23, 2018

TNERA now Robocasting on Letsrobot.tv

The Totally Not Evil Robot Army is now on LetsRobot.tv

you can now drive one of the robot, or many other enthusiast robots through the robot streaming system.




I have converted the original RC Cart Robot - Polybot, to be on LetsRobot.tv.

Polybot


check out the site (Polybot on LetsRobot.tv) and if the robot is streaming you can control it.

Friday, November 9, 2018

Are Remote Robot Games a 'Thing' yet?

In the past 2-3 years there is a convergence of technologies that are enabling the streaming and control of robots through the internet.  However, remote robotic control, for fun purposes like gaming is still in its infancy.  Why is this?  Why is remote reality gaming and robotic gamings still not a 'thing' (yet)?

The Convergence:
Maker based Robot Creation, Home internet broadband capability, low cost of components, converging with YouTube Streaming, Twitch Game Play, as well as the introduction of chatbots, AI, and ML are converging to make the concept of remote robot games a reality.

I would start to differentiate these as webcams on robots, exploring with robots, and games with robots.  The control of the robot could be observational, or first person.

The most basic - watching robot games on TV, like the picture below. This is very basic robo-sport.  It could be interesting, but in the current state is not very engaging.



I think the real interest in being able to engage with the robot from the internet.  Being able to steer it, perform some action, and potentially meet some (game) objective.

Robospatium
The best example of that in a non-commercial setting would have to be at Homofaciens.de. Homofaciens has build an environment (Robospatium) where you can remotely through the internet connect to a rover-robot and steer it around.  These robots have be working for many years, probably one of, or the first of its kind.  In addition to the robot rover, Homofaciens has a wealth of information for physical computing.  Norbert has a very successful YouTube channel with great videos on building your own robots from everyday items.
R11 Rover - Image from Homofaciens.de
Check it out >> the Original!  In English and German
Homofacian's Robospatium  (https://homofaciens.de/robospatium_en.htm)



Let's Robot.TV - https://letsrobot.tv/

letsrobot.tv is the work of Jillian Ogle. She has been featured on the cover of Make Magazine. She is setting out (like the rest of us) to make robots accessible to everyone, fun and enjoyable.  Letsrobot.tv is a platform where you can view and control remotely robots that are created and 'living' in robocaster's locations. 

There is a heathly community of robot enthusiast developing around Letsrobot.tv. Easy instructions are available how to create and add your own robot to the letsrobot.tv platform. In addition to open source code for the development of the robot, runmyrobot, on Github.



The platform supports a chat function allowing you to participate in the control of the robots with others. Having some of the local tokens, you can steer the robots and have them say things.

There are a few varieties of robots available on the platform.  This would include "The Claw" game, where you can remotely operate a claw arcade game and try to grab prizes from with in.

The letsrobot.tv platform is just gearing up now.  It has received a lot of publicity from MAke and the Makers fair.  It is notable that the platform is handling the video streaming quiet well.  This is one of the more important elements of a remote controlled robot.



Twitch Generation
It seems that the natural platform for the streaming of remotely controlled robots would be Twitch.tv.  Twitch is the streaming platform for electronic games where you can watch professionals and amateurs play video games.  Truly a sign of the times, Twitch itself is the convergence of streaming and gaming communities. To add to this, Twitch has added a creative channel that provides a means for artists and craftsman to stream their creations. So, it would be natural for a robot to stream as well - especially an internet controlled robot.  (Twitch is not alone, YouTube also realizes the value in streaming gaming)


TheOtherLoneStart - Twitch Chat controlled robot battles

One Twitch streamer has recognized this next step and created a Twitch chat controller robot, and associated gaming feature.  If you tune into TheOtherLoneStar twitch streaming channel you may find him building robots, or hosting a battle between his robots.  All for fun, you can certainly internet remote control the bots and have fun with them.  He also has videos of the builds, play action, and a HackaDay project.

Remote Games
Finally there is a new style of remote robotic games that have been created by "Remote Games".  Remote Games is a Ukrainian company that is also "living the dream".  They have created a game that allows for up to 10 (20?) special robot explore and compete an a intricately designed set based on a ghost town near Chernobyl. (yes, the site of the nuclear melt down)


Hyper real set from Remote Games - Image from Remote Games

The hyper-real set is amazing!  Here, with a subscription, you can explore the ghost town with a robot tank and compete in real time with others in different game formats.  The game company is planning to offer franchises of their gaming platform for others to operate their own arenas.  I would liken the model to that of 'laser tag' business plan, but with an Internet audience.

Interesting to note, one of the founder stated "we noticed how quickly remote-controlled game robots are gaining popularity". I think that there view point matches many in the maker/robot community.  we are only just now starting to see the new use cases of robots, robot games, and remotely controlled robots.  

I think it will soon become a 'thing'.