This is quite strange. i had a similar problem with my rangefinder but i managed to get values after I initialised it in arduino.
Here is what my arduino script looks like (i am using the PiControl base sketch)
Code: Select all
// ************ THE SETUP ITEMS BELOW SHOULD GENERALLY BE USED FOR ALL SPIRIT SKETCHES **************
hardwareBegin(); //initialize Spirit's Arduino processor to work with his circuitry
SPI_Reset(); //resets and turns on the SPI port
playStartChirp(); //Play startup chirp and blink eyes
servoCenters(); //Place all servos back in default position
// ************ THE SETUP ITEMS BELOW CAN BE CUSTOMIZED FOR YOUR SPECIFIC SPIRIT SKETCH **************
SPI_Handler(); // looks for incomming SPI data (likely motor control instructions from Pi)
// add your own loop code here
}// end of loop() function
Notice the PIC_RangefinderEnable();
That's what did the trick for me. Also highly recommended to increase the shutdown delay to 10 seconds because I found the default 5 seconds is not enough and RasPi was losing power in the middle of its shutdown sequence. The rangefinder interval is optional but I set it to 10 and I haven't experimented with it since.
All in all, the above will simply pass all sensor data to the Pi and then I use the python scripts to retrieve the data and feed them over a UDP socket to my ubuntu VM where I can draw graphs and perform basic movement routines, effectively acting the same way as demo mode 2 of the shipping code, except it is performed over the network. It's quite neat and a great demonstrator of Cloud robotics and how important the network quality is for such applications.
I am currently in the process of adding gripper and servo functions to the manual control so I can manually drive the rover and also control the servos.