Skip to content

Beagle ​

Instance declaration ​

When you add a Beagle block to the workspace, the following instance declaration is automatically inserted into the Python code:

python
beagle = Beagle(0)
# When there are multiple instances
beagle_1 = Beagle(1)

Parameters ​

NameKindDescriptionRange / TypeDefault
indexDropdown optionInstance number (starting from 0)Integer 0 or greater0

Set wheel speed ​

Determines the wheel speed. The speed ranges from -100 to 100.

set_wheel_speed

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionWheel to controlleft, right, both-
speedInput (block)Wheel speedInteger -100 to 100, 0: stop-

Python ​

python
beagle = Beagle(0)

beagle.set_wheel_speed('both', 50)

Move a distance ​

Moves the specified distance at the current wheel speed.
If the wheel speed has not been set, it moves forward at the default speed.
If the distance is 0, it keeps moving according to the current wheel speed.
If wait is checked, execution waits until the movement is complete.

move_distance

Parameters ​

NameKindDescriptionRange / TypeDefault
dataInput (block)Distance to moveReal number 0 or greater-
unitDropdown optionDistance unitcm, mm, inchcm
waitCheckboxWhether to wait for completionTRUE / FALSETRUE

Python ​

python
beagle = Beagle(0)

beagle.move_distance(50, 'cm', wait=True)

Move for a time ​

Moves for the specified time at the current wheel speed.
If the wheel speed has not been set, it moves forward at the default speed.
If wait is checked, execution waits until the movement is complete.

move_time

Parameters ​

NameKindDescriptionRange / TypeDefault
dataInput (block)Time to move (seconds)Real number 0 or greater-
waitCheckboxWhether to wait for completionTRUE / FALSETRUE

Python ​

python
beagle = Beagle(0)

# wait = TRUE
beagle.move_time(5, wait=True)
# wait = FALSE
beagle.move_time(0.5, wait=False)

Turn in place ​

Sets the direction and angle to rotate in place.
If wait is checked, execution waits until the rotation is complete.

turn_degree

Parameters ​

NameKindDescriptionRange / TypeDefault
directionDropdown optionDirection of rotationleft, right-
dataInput (block)Angle of rotation (degrees)Real number 0 or greater-
waitCheckboxWhether to wait for completionTRUE / FALSETRUE

Python ​

python
beagle = Beagle(0)

beagle.turn_degree('left', 90, wait=True)

Change wheel speed ​

Changes the wheel speed of Beagle.
The new wheel speed is the current wheel speed plus the speed you enter.
The newly set wheel speed is clamped to the range -100 to 100.

change_speed

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionWheel to controlleft, right, both-
speedInput (block)Amount of speed changeInteger -200 to 200-

Python ​

python
beagle = Beagle(0)

beagle.change_wheel_speed('both', 10)

Stop ​

Stops the movement of Beagle.
The speed of both wheels of Beagle is reset to 0.

stop

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.stop()

Is the wheel moving? ​

Returns true if the wheel is moving, and false if it is stopped.

wheel_moving

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.wheel_moving()

Set sound buzz ​

Sets the buzzer sound of Beagle to the specified frequency.
The frequency range that can produce sound is 27.5 Hz to 6553.5 Hz.
If you enter a value outside this range, no buzzer sound is produced.

sound_buzz

Parameters ​

NameKindDescriptionRange / TypeDefault
hzInput (block)Frequency (Hz)Real number 0, or 27.5 to 6553.5 (0 otherwise)-

Python ​

python
beagle = Beagle(0)

beagle.sound_buzz(440)

Play a note ​

Beagle plays the specified note.

sound_note

Parameters ​

NameKindDescriptionRange / TypeDefault
noteDropdown optionNoteDo (C), Do# (C#), Re (D), Re# (D#), Mi (E), Fa (F), Fa# (F#), Sol (G), Sol# (G#), La (A), La# (A#), Si (B)-
octaveDropdown optionOctave1, 2, 3, 4, 5, 6, 74

Python ​

python
beagle = Beagle(0)

beagle.sound_note('D', 5)

Play a sound clip ​

Beagle plays a particular sound clip.
If wait is checked, execution waits until playback is complete.

sound_clip

Parameters ​

NameKindDescriptionRange / TypeDefault
clipDropdown optionSound clip name'mute', 'beep', 'siren', 'engine', 'robot', 'dibidibidip', 'happy', 'angry', 'sad', 'sleep', 'march', 'birthday', and so on-
waitCheckboxWhether to wait for completionTRUE / FALSETRUE

Python ​

python
beagle = Beagle(0)

beagle.sound_clip('siren', wait=True)

Sound off ​

Turns off the sound of Beagle.

sound_off

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.sound_off()

Is a sound playing? ​

Returns true if a sound is playing, and false if it is not.

sound_playing

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.sound_playing()

Wheel speed value ​

The speed of a particular wheel

wheel_speed

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionWheel to readleft, right-

Python ​

python
beagle = Beagle(0)

beagle.wheel_speed('left')

Encoder value ​

The encoder value of a particular wheel

encoder

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionWheel to readleft, right-

Python ​

python
beagle = Beagle(0)

beagle.encoder('left')

Gyroscope sensor value ​

The value of the gyroscope sensor along a particular axis

gyroscope

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionAxis to measurex, y, z-

Python ​

python
beagle = Beagle(0)

beagle.gyroscope('x')

Accelerometer sensor value ​

The value of the accelerometer sensor along a particular axis

accelerometer

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionAxis to measurex, y, z-

Python ​

python
beagle = Beagle(0)

beagle.accelerometer('x')

Magnetometer sensor value ​

The value of the magnetometer sensor along a particular axis

magnetometer

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionAxis to measurex, y, z-

Python ​

python
beagle = Beagle(0)

beagle.magnetometer('x')

Temperature sensor value ​

The temperature sensor value

temperature

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.temperature()

Signal strength value ​

The signal strength

signal_strength

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.signal_strength()

Battery voltage ​

The battery voltage

battery

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.battery()

Whether the state has changed ​

Whether the state of the robot has changed

state_change

Parameters ​

NameKindDescriptionRange / TypeDefault
unitDropdown optionKind of state0 to 5 (see the table below)-
unitCondition
0accelerometer('x') > 0.8
1accelerometer('x') < -0.8
2accelerometer('y') > 0.8
3accelerometer('y') < -0.8
4accelerometer('z') > 0
5accelerometer('z') < 0

Python ​

python
beagle = Beagle(0)

# unit = 0
beagle.accelerometer('x') > 0.8

Turn the lidar on / off ​

Enables or disables the lidar sensor.

lidar_power

Parameters ​

NameKindDescriptionRange / TypeDefault
onDropdown optionLidar ON / OFFstart (True), stop (False)TRUE

Python ​

python
beagle = Beagle(0)

beagle.lidar_power(True)

Distance value of the Nth object from the lidar ​

The lidar sensor can measure the distance to objects all around, over 360 degrees.
Starting from the front of Beagle (value number 0), the number increases by 1 as you go counterclockwise.

lidar_value

Parameters ​

NameKindDescriptionRange / TypeDefault
unitInput (field)Object number (starting from 0)Integer 0 or greater-

Python ​

python
beagle = Beagle(0)

beagle.lidar_value(0)

Lidar distance value by direction ​

Gives the distance measured by the lidar sensor to the front, back, both sides, and the diagonal directions.
It outputs the average of the distance values within 45 degrees to the left and right of that direction.

lidar_directions

Parameters ​

NameKindDescriptionRange / TypeDefault
directionDropdown optionDirection to measurefront, left front, left, left back, back, right back, right, right front-

Python ​

python
beagle = Beagle(0)

beagle.lidar_directions('front')

Is the lidar ready? ​

Returns whether the lidar is on as true (True) / false (False).

lidar_state

Parameters ​

(none)

Python ​

python
beagle = Beagle(0)

beagle.lidar_ready()