(relatively) Simple Halloween Project
Hello everybody,
My name is Steve and I'm pretty new to robotics. I got an ActivityBot for my birthday and I've been playing around with it a good deal. Now Halloween is coming up and I would like to turn my ActivityBot into a display at a haunted house that my college chapter of the Florida Engineering Society is hosting. My idea is to mount a decorative "head" on top of the main chassis of the ActivityBot, and have a rotating PING))) sensor detect objects in a range around the chassis, then, compare distances of objects around the ActivityBot and simply "point" the front of the head towards the nearest of the objects.
The purpose is for the "head" to simply rotate in order to be "looking at" the nearest person walking in front of the ActivityBot until that person moves out of range, then to find the new "nearest object" and rotate to be "looking at" that object. I was thinking that the easiest way to acheive this would be to have the chassis stay completely still, and just mount the "head" on a rotating platform that could then be turned by the servo's of the ActivityBot.
I've been programming in C using SimpleIDE as the tutorials for the activity bot recommend, and I would just like some help developing the code I can use for my project as I have little programming experience outside of the ActivityBot tutorial.
If this should be posted somewhere else in the forum's please let me know.
Thanks
~Steve
My name is Steve and I'm pretty new to robotics. I got an ActivityBot for my birthday and I've been playing around with it a good deal. Now Halloween is coming up and I would like to turn my ActivityBot into a display at a haunted house that my college chapter of the Florida Engineering Society is hosting. My idea is to mount a decorative "head" on top of the main chassis of the ActivityBot, and have a rotating PING))) sensor detect objects in a range around the chassis, then, compare distances of objects around the ActivityBot and simply "point" the front of the head towards the nearest of the objects.
The purpose is for the "head" to simply rotate in order to be "looking at" the nearest person walking in front of the ActivityBot until that person moves out of range, then to find the new "nearest object" and rotate to be "looking at" that object. I was thinking that the easiest way to acheive this would be to have the chassis stay completely still, and just mount the "head" on a rotating platform that could then be turned by the servo's of the ActivityBot.
I've been programming in C using SimpleIDE as the tutorials for the activity bot recommend, and I would just like some help developing the code I can use for my project as I have little programming experience outside of the ActivityBot tutorial.
If this should be posted somewhere else in the forum's please let me know.
Thanks
~Steve
Comments
Also, I'll remind people before Halloween that a simple TV IR remote control works great outdoors at night. Second video shows my IR-triggered routine.
The idea I had was to assign a variable to each of 5 or 6 different positions along the arch that the ping sensor travels, then have it check those values against each other to find which is the smallest, and then move the that position. That way, it will always choose the closest person and not just the first person within a given range. Each time the ping traveled its arch, it would rewrite(refresh?) those variables so that it is continuously searching for the nearest person. Of course, having the idea and know how to actually code it is two very different things.
So, the way I see it, the differences between your setup and mine are then, where you want the sensor to stop when it see something, I want mine to continue to move constantly but tell the computer which of the directions has the smallest distance assigned to it, then move a decorative piece on top of the robot towards that direction.
I guess what I am asking for is examples of code that might achieve something similar to what I want, that I can then change and use for my own project as I have very little experience writing my own code.
Have you seen the PING-dar demo?
I've watched that video, and it looks like it would be a great deal of help, except that all of it is done in reference to the Boe-Bot, and done in a completely different programming environment than what I was using for the ActivityBot tutorials. As I said in the first post, I have really only used SimpleIDE which codes in C I believe(could be C++), but all the source code for that Ping)))dar video are done in an environment that my computer does not recognize. So I have no way of using it for my project. To be honest, im not even sure how to move the 3rd servo that ive just attached to my robot, though im pretty sure I've attached it correctly.
Those are continuous rotation servos. It could be argued (and IMO successfully) those aren't really servos. They can be commanded to move a certain speed but you can't tell them which position to move. If you used the encoders which came with the AB, it could be possible to monitor the position of the "servo" but it's not really a trivial task (which moving a servo is).
Have you looked through the Learn tutorials for normal servo examples? I'd be very surprised if there aren't examples of using SimpleIDE to program servo movement.
I don't use C with the Propeller much myself so I'm not sure where to look.
I could find you lots of information about controlling servos with Spin.
Ive done all of the tutorals found here at the bottom of the page. I also looked through the Learn Forum but I did not see anything that I thought would be usefull. If I missed something or I should look somewhere else please let me know.
learn.parallax.com/propeller-c-simple-devices/standard-servo
I think it's a good starting point.