The amazing blobfinder!

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

The amazing blobfinder!

Hi everyone,

What I am trying to do is a slight modification of Jennifer Owen's tutorial example of an obstacle avoiding/destroying-blobfinding robot. In her example, she coded Bigbob's blobfinder to search for two colours.

(taken from>
# bigbob's blobfinder
define bigbobs_eyes blobfinder
# number of colours to look for
colors_count 2
# which colours to look for
colors ["orange" "DarkBlue"]

This is linked to the controlling code ( via the BlobfinderProxy.

I want to create two robots to each detect a specific colour i.e
Bigbob1 -> Detect DarkBlue
Bigbob2 -> Detect orange

Q1. How do I change the file to reflect the change?

1.1 Do I do something like

define bigbobs_eyes1 blobfinder
define bigbobs_eyes2 blobfinder

in the same .inc file?

1.2 Or do i create a separate .inc file for each robot with everything the same except one detects orange and the other blobfinder detects darkblue?
     - This seems like an additional and unnecessary step similar to creating a totally new robot.

Q2. How do I link the above change to the .cc file ( and & bigbob.cfg file

2.1 I'm guessing I change the ports used for each robot in the bigbob.cfg file to

driver( name "stage"
provides ["6665:position2d:0" "6665:sonar:0"
"6665:blobfinder:0" "6665:laser:0"]
model "bob1" )

driver( name "stage"
provides ["6666:position2d:0" "6666:sonar:0"
"6666:blobfinder:0" "6666:laser:0"]
model "bob2" )

and change accordingly in the respective files.

Yup that's it. I hope my explanation is clear and that my attempts at answering my own questions are meant to show my thought processes. Would greatly greatly appreciate if any kinds souls could enlighten me. Thanks in advance!