Releases: arduino/arduino-alvik-mpy
0.2.0 - fixs, units, colors
Release notes 0.2.0
Note: This package requires firmware 0.3.0
Now all methods, set and get data in centimeters, you can change units by passing the unit
parameters,
Available units are (first is default):
- distances:
cm
,mm
,m
,inch
- angles:
deg
,rad
,%
,rev
- linear velocities:
cm/s
,mm/s
,m/s
,inch/s
,%
- angular velocities:
deg/s
,rad/s
,%
,rev/s
,rpm
(note: wheel speed default is in RPM)
Fixs:
- improved communication parser
- improved UART baud rate
New methods available:
brake
, stops motorsget_color(<format>)
, return normalized color ifformat = 'rgb'
or hsv values ifformat = 'hsv'
get_color_label(<h>, <s>, <v>)
, return the string label of the detected color, such as'red'
color_calibration(<white/black>)
, pass'white'
or'black'
to calibrate upper or lower limitget_distance_top(<unit>)
, return distance above the robot in centimeters, useunit
to change the unitget_distance_bottom(<unit>)
, return distance in the bottom part of robot in centimeters, useunit
to change the unitset_behaviour(<behaviour>)
, set internal behaviours, at the moment0 disable
and1 automatically turn off the illuminator when you lift the robot
set_wheels_position(<left>, <right>, <unit = 'deg'>)
, set position of both wheelsget_wheels_position(<left>, <right>, <unit = 'deg'>)
, get position of both wheelsget_drive_speed(<linear_unit = 'cm/s'>, <angular_unit = 'deg/s'>)
, get drive speed
Introducing color calibration, how to
Generally default parameters could give you issues, so it is suggested to calibrate your sensor.
You need a white surface and a black surface.
Connect your robot to Labs for Micropython and type in REPL terminal:
>>> from arduino_alvik import ArduinoAlvik
>>> alvik = ArduinoAlvik()
>>> alvik.begin()
Now place your robot on the white surface and type:
>>> alvik.color_calibration('white')
Now place your robot on the black surface and type:
>>> alvik.color_calibration('black')
Press reset on Lab for Micropython.
You can now test using read_color_sensor.py
in examples folder.
colors are tested on paper painted using acrilic marker pens, such as UNIPOSCA, or paper printed with an inkjet printer
0.1.0 - new API
This is the pre-release 0.1.0. It is a huge update despite the 0.0.7 pre-release.
Following you can find the major new API.
Note: this micropython package requires at least Arduino_AlvikCarrier version 0.2.0
Robot related commands:
-
begin
, initialize the robot -
rotate(<deg>)
, rotate the robot of deg, you can also set blocking to false and check accomplishment withis_target_reached()
-
move(<mm>)
, drive straight the robot of mm, you can also set blocking to false and check accomplishment withis_target_reached()
-
drive(<mm/s> , <deg/s>)
, set linear velocity and angular velocity of the robot -
(mm/s, deg/s) get_drive_speed()
, get drive data -
(x, y, theta) = get_pose()
, get the pose of the robot in the 2D environment -
reset_pose(<x>, <y>, <theta>)
, reset the pose of the robot, by default x ,y, theta are 0 -
set_wheels_speed(<left rpm>, <right rpm>)
, replace old set_speeds() -
(<left rpm>, <right rpm>) = get_wheels_speed()
, replace old get_speeds() -
(ax, ay, az, gx, gy, gz) = get_imu()
, get data from IMU in g and deg/s -
(ax, ay, az) = get_accelerations()
, get accelerometer data in g -
(gx, gy, gz) = get_gyros()
, get angular velocity from gyroscope data in deg/s -
(roll, pitch, yaw) = get_orientation()
, get orientation data from sensor fusioning
Wheel related commands:
set_position(<deg>)
, set the absolute position of the wheel in degrees(deg) get_position()
, get the position of the wheel in degreesreset(<initial position>)
, reset the absolute position of the wheel in degrees, intial position is 0 by defaultstop()
, brake the wheelset_speed(<rpm>)
, set wheel speed in RPM(rpm) = get_speed()
, get wheel speed in RPM
Other new commands:
<led>.set_color(<R>, <G>, <B>)
, set color on led with boolean R, G, B values(R, G, B) = get_color_raw()
, get color in raw format
0.0.7 - first release
This release is preliminary.
Check readme to flash firmware and install the library