A* pathfinding via Bluetooth

Post your NXJ projects, project ideas, etc here!

Moderators: imaqine, 99jonathan, roger

New User
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

A* pathfinding via Bluetooth

Postby SpikeT » Mon Mar 22, 2010 4:30 am

I'm creating a program for controlling NXT from PC via Bluetooth.
User can control the robot to search and then save object locations
into a database.

After that the robot can run autonomously to any know objects
by using A* (A-star) search algorithm.

I posted a video showing a sample of what this program could do at


Hope this can help you guys for any project idea

New User
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

Postby SpikeT » Sat Apr 17, 2010 11:48 pm

I upload a new video at


some comment would be nice...guy

User avatar
leJOS Team Member
Posts: 5969
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby gloomyandy » Sun Apr 18, 2010 7:56 am

Interesting video. Would like to see a little more about your internal map representation (would be good to see your A* algorithm actually choosing a path. Also do you store any notion of the size/occupied space of each object in your map? What about the size of the robot, is that represented at all? Also do you really need an SQL database for 3 objects? What are the advantages of using that rather than simply storing things in memory?

New User
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

Postby SpikeT » Mon Apr 19, 2010 4:28 am

Thanks for the comment,

You were right about using DB for only 3 objects, but
I did it this way because I can have more options to play with
in the future.

Mapping all objects on the map is sure troublesome. I'm
using simple grid-map the grid size is 1x1 cm.
The objects that I put on the map are a robot current position,
estimate origins of the obstacles, and target positions.

Before running the pathfinding algorithm, the size of those
objects will be expanded(from the center).
The key is I put extra clearance
space when expanding the obstacle.

obstacle -> 30x30 (object =10 and 10 more on each side for clearance)

The pathfinding algorithm was modified from http://www.policyalmanac.org/games/aStarTutorial.htm

By the way, do you know where I can find some other
mapping technique that works well with NXT(only one sonar sensor)?

New User
Posts: 19
Joined: Tue Sep 22, 2009 3:44 am

Postby SpikeT » Wed Apr 21, 2010 1:00 am

I posted a new video at

showing more about pathfinding.

New User
Posts: 11
Joined: Wed Jul 14, 2010 5:45 am

Postby tlaukkan » Wed Jul 14, 2010 10:07 am

Hi SpikeT

I have started to work on similar project and plan to release any thing useful as open source. Would be interesting to exchange ideas and links to existing work in the internet.

I am using ultrasonic sensor as well to find distances to objects and walls. Still testing the sensor so I am not sure whether I would need to update to optical one to get accurate enough data.

Do you think raster or vector based data structure better for storing map information?


Return to “NXJ Projects”

Who is online

Users browsing this forum: No registered users and 1 guest