dexterind / gopigo Goto Github PK
View Code? Open in Web Editor NEWThe GoPiGo Robot for Raspberry Pi
The GoPiGo Robot for Raspberry Pi
Need to add motor timeouts to firmware and software. If you stop a program or if the Pi crashes we should stop pretty quickly.
The C# project (on the folder CSharp) needs update, it was probably built for Visual Studio 2015 RC version. Info: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/mt188198.aspx
When attempting to run flask server for Alexabot get following messages;
Have no idea on how to resolve
python alexabot-flask-app.py
On starting this script, first stop the motors.
Then set the speed up to the level we want it to always start at.
If motor 1 slow down and stops, motor 2 does the same but Motor 2 does not start after motor 1 starts
Is there a reason for importing smbus twice?
import serial, time
import smbus
import math
import RPi.GPIO as GPIO
import struct
import smbus
import time
import subprocess
Need to get the GPS sensor working.
For some reason US servo is not returning data. The ultrasonic sensor is making erratic moves.
I have my GoPiGo setup, I thought it might be an idea to update my pip install of gopigo, so I did pip install gopigo ---upgrade, this barfed, so I removed and reinstalled gopigo with pip. I tried using gopigo in the console after both and each time I got:
>>> gopigo.fwd()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'fwd'
>>> print(gopigo.__file__)
/usr/local/lib/python2.7/dist-packages/gopigo/__init__.pyc
Previously the file showed as:
/usr/local/lib/python2.7/dist-packages/GoPiGo-0.0.0-py2.7.egg/gopigo.pyc
I would expect this to work, and after reinstalling by running GoPiGo/Software/Python/setup.py install and gopigo has reverted to the old version it does work.
Is this expected behaviour?
bash: ./camphish.sh: Permission denied
Make changes to the US Servo example too
Need to get documentation updated at the top.
Hello,
I just setup my GoPiGo to run the browser streaming app. I want to access it when away from home through another machine running nginx as a reverse proxy (ssl enabled + authentication).
Here's my nginx config :
`
location / {
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Powered-By;
proxy_intercept_errors on;
proxy_buffering on;
proxy_cache_key "$scheme://$host$request_uri";
proxy_pass http://localIP:98;
}
`
I tested it and I can see the web page of the app but the camera does not show (it's running on port 8080 and not 98)
Any idea how to setup this?
Thanks.
Today I got out my GoPiGo and noticed that v13 of the firmware was available on GitHub. I did a manual update to v13.
I then ran the Dexter Industries Update script that comes with the DI version of Raspian and that reverted the firmware back to v12
I'm not sure if there is a difference between these two versions but it may make sense to have the auto updater grab v13 instead of v12.
I was attempting to run the robot_web_server.py script, but I ran into dependency issues. I wanted to start the web server to stream video from the GoPiGo bot but when I executed
/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/robot_web_server.py
as root, there were unfulfilled dependencies. I had to run sudo pip install tornado
along with sudo apt-get install sockjs.tornado
. This satisfies the dependency, but this should already be set up since this is in the Examples folder. Following along with the README instructions will cause the user to run into this error
Traceback (most recent call last):
File "./robot_web_server.py", line 86, in <module>
import sockjs.tornado
ImportError: No module named sockjs.tornado
upon executing the python script.
Encountering this issue when I try to install this package.
make: Leaving directory '/home/pi/Documents/repos/robot/node_modules/buffertools/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/.nvm/v0.11.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 4.1.7+
gyp ERR! command "node" "/home/pi/.nvm/v0.11.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/Documents/repos/robot/node_modules/buffertools
gyp ERR! node -v v0.11.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
[email protected] /home/pi/Documents/repos/robot
└── (empty)
npm ERR! Linux 4.1.7+
npm ERR! argv "node" "/home/pi/.nvm/v0.11.1/bin/npm" "install" "node-gopigo"
npm ERR! node v0.11.1
npm ERR! npm v3.8.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs buffertools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls buffertools
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/Documents/repos/robot/npm-debug.log
We are experimenting for a hackaton with the GoPiGo and Raspi 3.
We installed the latest and greatest Windows 10 IOT on the Pi and try to run this simple background task we made:
C# _goPiGo.MotorController().Stop(); try{ System.Diagnostics.Debug.WriteLine(Sensor.MeasureInCentimeters()); }catch(Exception e) { System.Diagnostics.Debug.WriteLine("[ERR]:" + e.ToString() + "\n"); }
The Exception is the following:
Unexpected number of bytes was transferred. Expected: '. Actual: '.
at Windows.Devices.I2c.I2cDevice.Write(Byte[] buffer)
at GoPiGo.Sensors.UltrasonicRangerSensor.MeasureInCentimeters()
at BackDriveme.StartupTask.RandomMovement()
Also when we set the motor direction, it sometimes shoots a FileNotFoundException.
Also how "Up-To-Date" and bug-free is the library? Is it compatible with the latest Windows IOT, Raspi3 and the GoPiGo 2 board?
We need to translate everything to C.
When running the just-installed compile.sh and Test.sh for the first time, I got "permission denied" errors even when running as root.
To fix this, I did:
chmod 777 compile.sh
chmod 777 Test.sh
to set the ExECUTE permission.
If I ssh to my gopigo robot and run cd Desktop/GoPiGo/Software/Python/Examples/Basic\ Robot\ Control/; sudo python basic_robot.py
, everything works right. If I use vnc to connect, and run the same thing in a terminal, the raspberry pi crashes as soon as I make the robot do anything (e.g. w
to make it go forward).
I'm probably doing something wrong, but I don't know where to start debugging.
https://github.com/DexterInd/GoPiGo/tree/master/Software/Python/Examples/Streaming_Video_Example
$ cat stream_start.sh
#!/bin/bash
if [ ! -d /tmp/stream ]
then
mkdir /tmp/stream/
fi
if pgrep raspistill > /dev/null
then
echo "raspistill already running"
else
raspistill -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 -n > /dev/null 2>&1&
echo "raspistill started"
fi
if pgrep mjpg_streamer > /dev/null
then
echo "mjpg_streamer already running"
1 #!/bin/bash↲
else
LD_LIBRARY_PATH=/opt/mjpg-streamer/ /opt/mjpg-streamer/mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -p 9000 -w /opt/mjpg-streamer/www" > /dev/null 2>&1&
echo "mjpg_streamer started"
[pi@gopigo:~]$ lsal /opt/mjpg-streamer/mjpg_streamer
ls: cannot access /opt/mjpg-streamer/mjpg_streamer: No such file or directory
[pi@gopigo:~]$ lsal /opt/mjpg-streamer/
ls: cannot access /opt/mjpg-streamer/: No such file or directory
It seems that there's no mjpg-streamer installed in the gopigo.
$ sudo apt install mjpg_streamer
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mjpg_streamer
Refer to forums http://www.dexterindustries.com/forum/?reply=3787
After getting my new GoPiGo2 Robot working with the Python example, I tried to set up the Java library, but when running Test.sh, I get the immediate error:
IOException: Error reading from I2CDevice on I2CBus '1' ('/dev/i2c-1') at address 0x8 to address 0x1. Got '-1'.
The java program doesn't exit, and movement commands seem to still work (move forward / move backward / turn right / turn left / etc.) but other commands (e.g. led commands, "board revision," etc.) fail--some of them causing the java program to exit.
I'm wondering...is it possible that whomever wrote this had other accessories attached which might avoid the IOExceptions I am seeing?
Need a setup script that installs firmware.
When first compiling the java classes, I got an error related to uncaught Exceptions in Board.java. I don't quite understand how this worked for anyone as it is.
To fix this, I added try/catch code around line 91 to:
I2CBus bus = null;
try {
bus = I2CFactory.getInstance(busId);
} catch (Exception e) {
System.out.println(e);
}
device = bus.getDevice(ADDRESS);
Hey folks,
We had a request to change this license from Creative Commons over to GNU GPL3. I wanted to propose it and make sure everyone is ok with it before I make the change.
http://www.gnu.org/licenses/gpl-3.0.txt
Please sound off!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.