Skip to content

Instantly share code, notes, and snippets.

View ibraEssam's full-sized avatar
🇵🇸
Free Palestine

Ibrahim Essam ibraEssam

🇵🇸
Free Palestine
View GitHub Profile
#!/usr/bin/env python
import sys
import os
import logging
from types import *
import time
from pycarmaker import CarMaker, Quantity
import rospy
from std_msgs.msg import Float32
FORMAT = '[%(levelname)6s] %(module)10s: %(message)s'
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
%% setup
hold all
a=arduino;
mpu=i2cdev(a,'0x68'); %mpu adress is normally 0x68
writeRegister(mpu, hex2dec('B6'), hex2dec('00'), 'int16'); %reset
data=zeros(10000,14,'int8'); %prelocating for the speed
j=1;
a1 = animatedline('Color',[1 0 0]);
a2 = animatedline('Color',[0 1 0]);
a3 = animatedline('Color',[0 0 1]);
class Example:
def on_start(self):
''' [Optional] Called at the beginning when the block starts. '''
pass
def on_new_messages(self, messages):
''' [Optional] Called according to the execution mode of the block.
Parameters
Header header
# Range 0 to 1, 1 is max throttle
float64 throttle
# Range 0 to 1, 1 is max brake
float64 brake
# Range -1 to +1, +1 is maximum left turn
float64 steer
uint8 NO_COMMAND=0
from prius_msgs.msg import Control
class CarDemoControl:
def on_start(self):
self.throttle = 0.5
self.brake = 0
self.steer = 0
self.shift_gears = Control.FORWARD
def on_button_clicked(self,key):
if key == 'stop':