示例#1
0
def rpi2research(initial_angle=160,
                 final_angle=90,
                 final_bits=8,
                 final_rows=224,
                 final_cols=224):
    """
	Inputs:
		initial_angle	:	Float. Viewing angle of input_image.
		final_angle		:	Float. Desired viewing angle of the output image.
		final_bits		:	Integer. The number of bits used to define an
							individual pixel in the output image.
		final_rows		:	Integer. The number of rows in the output image.
		final_cols		:	Integer. The number of columns in the output image.
	Returns:
		None.
	"""
    # Set up the connection to the Raspberry Pi
    # defines a vehicle to take and record pictures 10 times per second
    V = Vehicle()

    #add a camera part
    #cam = PiCamera()
    cam = vid2research(0)

    V.add(cam, outputs=['image'], threaded=True)

    #add tub part to record images
    tub = Tub(path='~/mycar/get_started',
              inputs=['image'],
              types=['image_array'])
    V.add(tub, inputs=['image'])

    #start the drive loop at 10 Hz
    V.start(rate_hz=10)
示例#2
0
import sys
sys.path.append('/home/royd1990/donkeycar')
from donkeycar import Vehicle
from donkeycar.parts.camera import MockCamera
from donkeycar.parts.datastore import Tub

V = Vehicle()

#add a camera part
cam = MockCamera()
V.add(cam, outputs=['image'], threaded=True)

#add tub part to record images
tub = Tub(path='~/d2/gettings_started',
          inputs=['image'],
          types=['image_array'])
V.add(tub, inputs=['image'])

#start the drive loop at 10 Hz
#V.start(rate_hz=10)