Skip to content

Conversation

@dr-soong
Copy link
Contributor

@dr-soong dr-soong commented May 3, 2022

Mega-PR here. This is an update to the slam simulator. It incorporates changes made to the side branch 'trislam' and extends those to include path finding and autonomous navigation.

The paradigm here is largely stream processing. It makes use of the database (direct access) but not of rules. Previous versions did use rules, but they added complexity w/o providing additional functionality. This is a simple SLAM example, particularly as it doesn't address the L(ocalization) part of the algorithm. It's possible rules could help w/ that, but it's also possible that the heavy computations necessary for localization wouldn't be a good fit w/in rules.

The world map the bot uses to navigate is a json file in data/, and the name of the file is supplied to the app on the command line. The easiest way to run the app is to cd to src/ and then 'make run', modifying the Makefile as necessary to determine which map to use (other options are commented out in the 'run' target). Images of the bot's view of the world are written to src/, and the ffmpeg command to generate a movie from those images is in a comment at the top of main.cpp.

This example uses make instead of cmake. At some point cmake broke and it was easier to switch back to make to proceed, esp. as make provided more easily controlled functionality, such as compiling individual files and adding utility make targets, like run, drun, clean_images, etc.

The largest chunk of code is in occupancy.cpp and the supporting file path_map.cpp. This represents the occupancy grid and implements a path-finding algorithm in the grid. The path-finding element (path_map.cpp) is leveraged from an open source project I have, and 'imported' to Gaia with open-source constraints being removed.

Steve Harris and others added 30 commits February 6, 2022 13:33
{
public:
txn_t();
~txn_t() { ; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I believe you can just omit the destructor.

constexpr uint32_t c_rule_wait_millis = 100;
using std::this_thread::sleep_for;

static constexpr uint32_t c_rule_wait_millis = 50;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is not used anymore?

int32_t reached_destinations = 0;
g_running = true;
// When the simulation completes it will set g_quit to 1. Then we can
// exit. In the meantime, the simulation is being handled by rules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lies! (from what you've said...)

@daxhaw
Copy link
Contributor

daxhaw commented May 4, 2022

What you've created here is a SLAM implementation to "beat"! This a good learning experience for Gaia in terms of establishing a baseline that we can use to compare a rules implementation to a "native" one without using rules. I see lots of areas for exploration here should we have the time/inclination to delve into this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants