shawn at May 16th, 2014 16:56 — #7
Good to know that everything's working out for you.
Johnny-five's documention may be helpful if you run into any problems. I used servo motors, other motor types may require different ways to control them.
robert_n_hunt at June 12th, 2014 16:32 — #8
Hi, I am trying to run the server.js on a Windows XP system. I have Node -v0.10.28-x86 up and running and npm installed socket.io express and johnny-five. When I try to run the server.js I get the following error and console output.
Error: Most middleware (like json) is no longer bundled with Express and must
installed separately. Please see https://github.com/senchalabs/connect#middleware
at Function.Object.defineProperty.get (C:\Node\rc-car-controller\node_mod
at Object. (C:\Node\rc-car-controller\server.js:21:17)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
I tried npm installing the package.json file from that site but still the same error. Any help would be appreciated. I think your project is really grate and more advanced and to the point then any other Node, Arduino, Express example out their.
shawn at June 12th, 2014 22:38 — #9
Looks like a new version of express.js came out since I wrote up the blog post. It's v4 now, while the blog post used v3. As the error indicates, express 4 redid how middle-ware is handled, so my code probably won't work.
I haven't looked at express 4 yet, so I'm not sure what will need to be changed, though perhaps the migration guide might be useful:
Alternately, you could install the previous version of express:
npm install firstname.lastname@example.org
Thanks for trying the code, let me know if this helps.
shawn at June 13th, 2014 00:27 — #10
Comment section for "Derivatived Object Tracking RC Car Hack Part 1"
Discuss the post here
Part 2 will be posted in a few more days.
shawn at June 13th, 2014 00:28 — #11
Comment section for "Control Your Robot With Node.js - Raspberry PI and Arduino"
Discuss the post here
shawn at June 13th, 2014 00:28 — #12
Comment section for "Servo Motor Wiring for People Who Never Tried It Before"
Discuss the post here
praful at February 11th, 2014 14:02 — #13
Here's the basic code we wrote to setup a slave Arduino listening to a RaspberryPi: https://gist.github.com/dasickis/8809624
shawn at June 13th, 2014 00:28 — #14
Comment section for "Beginning the Toy Car Project"
Discuss the post here
shawn at June 13th, 2014 00:33 — #15
This is the topic discussion for ShereCar’s automated toy car project. We’re focusing on developing an automated toy car for the community, which is a more accessible starting point than a full self driving car. This topic thread will be used for discussion and updates about the project, and we’ll be frequently updating this with new information. A blog post with slightly more details:
Our initial plan is to purchase an RC car and use the base, motors, and battery. We’ll attach a Raspberry Pi and camera (probably Kinect) for sensing, then develop an automation program to control it. It’ll also have a wireless device so people can interact with it.
shawn at January 10th, 2014 12:56 — #16
For next week, we will work at the Rutgers Livingston Makerspace from 1PM to evening. Feel free to join us there to talk or help out.
The Makerspace is at 35 Berrue Circle, Second Floor on the right. Parking is available behind the building, at least during the Rutgers winter break.
Makerspace website: http://makerspace.rutgers.edu/content/headquarters-rutgers
shawn at January 13th, 2014 15:53 — #17
We've bought a 1/10 scale electric RC car, and we'll be spending the week attaching a Rasberry Pi + camera to it. The goal this week is an electric RC car that can be controlled through a web browser.
Join us at the makerspace this week during the afternoons
turgaysenlet at January 17th, 2014 01:33 — #18
Hi, I have few suggestion for you, since I have built several autonomous toy-car/robot projects like this before. First of all I would either not go with a Raspberry PI or I wouldn't go with the Kinect. Raspberry PI could be too weak to stream and process real-time video using a USB connection. Instead, you can use the official Raspberry PI Camera (reference: http://www.raspberrypi.org/camera). It connects from the flex connector directly to the board so it bypasses the USB and lifts the USB streaming burden from the CPU. It is a nice and cheap camera and needs at most 2-3 minutes of setup time. Anyway Kinect would not work outdoors. Also Kinect itself requires external 12 Volts power supply (or 110V from the supplied adapter). The alternatives like Asus and PrimeSense are theoretically bus-powered (over USB), but Rapsberry PI cannot supply no such power to any device from its USB ports. By the way, I am not sure but, I am 80% sure that there would be no Kinect (or others) Linux driver for ARM architecture.
If you are looking for a better solution (not as cheap though), get the cheapest and smallest Intel motherboard and two fast but low-resolution USB cameras (like PS3-eye @30$) and build a stereo camera system so you can navigate both outdoors and indoors. I guess Raspberry would not be able to process stereo fast enough (unless anyone knows GPU programming well enough), and will not be able to power these cameras (you can use a powered-hub, which is generally more expensive then Raspberry PI itself ).
If you want to go with a single-camera setup, you will need to come up with a robust single-camera navigation and obstacle detection algorithm. Building such a system was my masters thesis back in 2006. It was successful as an experimental system, but I still think there is no good general solution for this problem that works in real-time and performs everywhere, especially on a platform as weak as Raspberry PI.
Another problem you will be facing is the batteries (as always has been in robotics). You may have to choose between battery life and weight since computer battery usage could be very high. Also you may use lighter Li-Ion or Li-Po batteries, which could be very expensive.
That is all, I hope you can forgive my openness about this, but I wouldn't want you to spend too much time on problems which you can solve early on the design stage.
Please let me know what you think and good luck!
shawn at January 21st, 2014 12:17 — #19
Some good points there.
We do have a Raspberry Pi Camera. One possibility is to use the PiCam for real-time navigation, and use the Kinect for more long term tasks such as room mapping (maybe done via cloud network). The RC car we bought does come with a battery, which we can use to power everything for now.
The wiring currently is pretty basic: Direct connections for power, ground and Pulse-width modulation signal. The Raspberry Pi will act as intermediary between processing and actuation.
shawn at March 1st, 2014 00:21 — #20
The recent snowstorms have disrupted things a bit, but here's a general overview of the the programs that run the Toy Car:
ShereCar Automated Toy Car Project Architecture
Stage 1: Webpage control with basic OpenCV reactions
- An "ai.py" robot script gathers and processes sensor data. This data and any robot commands is sent through a socket to a node.js server. It also looks for commands sent through the socket.
- A "node.js" server that acts as the communication hub via web sockets. It also makes use of johnny-five to control an attached arduino.
- A webpage that acts as a control interface for a user(s) using web sockets. Visitors will be able to view a via stream of the car camera and textual readout of gathered/process data. Buttons are also available to send commands to the car.
- An Arduino UNO that direct controls the motors on the RC Car
server.js - node.js server
Uses socket.io to handle communication between the various components of the Toy Car.
Also acts as a web server to provide a local index.html
- Define a HTTP server for index.html
- Listen for RPi webcam stream from Rpi - to forward to webpage
- Listen for additional RPi robot information from Rpi - to forward to webpage
- Listen for actuation commands from Rpi - to forward to Arduino UNO via Johnny 5
- Listen for robot commands from webpage - to forward to RPi
ai.py - robot sensors and logic
Uses the Raspberry Pi camera to stream video
Handles the data processing and decision making for the robot
- Define Raspbery Pi Camera
- Start video recording - video stream to socket
- Every step:
- Listen for robot command from socket
- Take still shot of current frame
- Apply needed OpenCV process
- Depending on command, generate appropriate action to send to Arduino
- Send data through socket
index.html - user webpage for robot interaction
Uses HTML5 websockets to communicate with other components
- Live webcam streaming retrieved from AI
- Status table for other robot data from AI
- Buttons to send commands over web socket through server to AI
tyler_c_folsom at March 6th, 2014 13:05 — #21
ElcanoProject has open source hardware and software available to support toy cars. Our system does not use vision, and thus runs on a set of four Arduinos, which consume less power than the raspberry Pi. Obstacle detection is done by sonar. Our base platform can be expanded to vision: use a more powerful processor such as a Tiva or Raspberry Pi to extract information from vision, and pass the results to the Arduino base system over USB.
praful at June 13th, 2014 00:37 — #22
shawn at June 19th, 2014 23:45 — #23
Comment section for "Derivatived Object Tracking RC Car Hack Part 2"
Discuss the post here
sehsarah at July 5th, 2014 19:58 — #24
Hey I have a similar johnny-five + socket.io + express app running on my Raspberry Pi to control my Arduino + motors via a web interface. It's been awesome getting it going, thanks for sharing your story!
The last struggle I'm having is in how to wirelessly power it all. Did you use the same power pack for both your Raspberry Pi & your Arduino? Two separate power packs? I have 6 rechargeable batteries powering the Arduino, and have trialled a connection from the 5V & GND pins of the Arduino to the Raspberry Pi micro usb, but alas that doesn't seem to be enough to boot it or power the wifi usb attached to the Pi.
Intrigued to know how you achieved your power supply and how long the robot can drive around without running out of power.
Thanks heaps for any info or tips you can share
shawn at July 7th, 2014 00:57 — #25
Good to see another Raspberry/Arduino project.
Figuring out how to battery power the Raspberry Pi was certainly an adventure (and a burned out RPi). In our case, we used the built-in RC Car battery to power everything. The 7.2 volt battery is connected to the Arduino's 5V pin, then the Arduino serial is linked to the RPi USB (normal, not micro). It's not ideal, as I think the Raspberry is supposed to only be powered through micro. Also, the RC battery is 7.2 volts when the Arduino expects 5 volts, we should be using a regulator.
The Pibot only needs 4 AA batteries to run the whole thing. I'm under the impression that the Raspberry wasn't designed to be powered through the 5V or 3.3V pin. I've been told the 3.3V pin is preferable, but both aren't protected and needs voltage regulation.
I know someone else who powered a USB hub, and had cables from that separately connecting to both devices.
While I was working on the hand-controller, I tried to channel all power through the Arduino and encountered issues. Perhaps the board's built in systems limit the amount of electricity that can go through it. We ended up powering the devices directly rather than through the Arduino.
Finally, have you had trouble keeping the wireless USB running?
On a raspberry pi, the wireless USB dongle is often set to utilize power saving, which can result in a dropped connection. If this is the case, a configuration file should be created to turn that feature off.
Outside Tutorial Page
- Create the config file:
- sudo nano /etc/modprobe.d/8192cu.conf
- Paste in the file:
- # Disable power saving
- options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1
- Some other guides state to set rtw_enusbss=0, use whatever works.
shawn at July 7th, 2014 15:32 — #26
A side post on setting up a Raspberry Pi: mostly software related.