LogoLogo
TRIK StudioTRIKLego EV3Lego NXT
English
English
  • TRIK help
  • TRIK Studio
    • About TRIK Studio
      • How to find out the version of TRIK Studio
    • Getting started and creating a project
    • TRIK Studio interface
      • TRIK Studio main menu
      • Working with graphs
      • How to open robot settings
      • How to change TRIK Studio interface language
    • TRIK Studio settings
    • 2D model
      • 2D model tuning
      • Adding restrictions to the 2D Model
        • Restrictions setting examples
    • Visual programming
      • Adding and removing blocks
      • Common blocks
      • Links between blocks
      • Syntax of expressions in the blocks
        • TRIK Studio language types
          • Array
        • TRIK Studio language tokens
        • TRIK Studio language operators
        • Constants
        • Sensor variables
        • Built-in functions
      • Property editing
      • Subprograms
    • Textual programming
    • Exercises
    • External tools
      • PuTTY
      • WinSCP
    • TRIK Studio shortcuts
    • Antivirus conflicts
      • Avast antivirus blocks TRIK Studio. What to do?
  • TRIK Studio Junior
    • About TRIK Studio Junior
      • How to find out the version of TRIK Studio Junior
    • Getting started and creating a project in TRIK Studio Junior
    • TRIK Studio Junior interface
      • How do I replace the "Character movement" image?
    • TRIK Studio Junior settings
    • Visual programming in TRIK Studio Junior
      • Adding and removing blocks in TRIK Studio Junior
      • Blocks in TRIK Studio Junior
      • Links between blocks in TRIK Studio Junior
      • Syntax of expressions in the blocks in TRIK Studio Junior
      • Property editing in TRIK Studio Junior
      • Subprograms in TRIK Studio Junior
    • Exercises in TRIK Studio Junior
  • INTEGRATIONS
    • PyCharm
      • Running a 2D model in TRIK Studio from PyCharm
    • Sublime Text
      • Running a 2D model in TRIK Studio from Sublime Text
      • Uploading programs to several TRIK robots from Sublime Text
    • VSCode
      • Running a 2D model in TRIK Studio from VSCode
      • Uploading programs to several TRIK robots from VSCode
  • TRIK controller
    • About the TRIK controller
      • Screenshot of the TRIK controller screen
    • TRIK controller firmware
      • How to find out the firmware version of the TRIK controller?
    • TRIK controller menu
    • Connecting to the TRIK controller via Wi-Fi
      • Connecting the TRIK controller to a computer and smartphone
      • Connecting the TRIK controller to TRIK Studio
      • Interaction of TRIK controllers
        • An example of solving a problem on the interaction of two robots
    • Connecting to the TRIK controller using UART
    • Launching and uploading programs to the TRIK controller
    • Programming TRIK with the visual programming language
      • TRIK specific blocks
      • Sensory variables for the TRIK controller
    • TRIK controller programming in Python and JavaScript
      • Object «brick»
        • Class «accelerometer»
        • Class «battery»
        • Class «colorSensor»
        • Class «display»
        • Class «encoder»
        • Class «gyroscope»
        • Class «keys»
        • Class «led»
        • Class «lineSensor»
        • Class «motor»
        • Class «objectSensor»
        • Class «sensor»
      • Object «script»
      • Object «mailbox»
      • Object «gamepad»
      • Object «Threading»
      • Function getPhoto
      • Function include
    • TRIK controller web interface
    • Connecting devices to TRIK and working with them
      • Connecting and working with the video module
      • Testing devices connected to the TRIK controller
      • Configuring the operation of a USB camera with a TRIK controller
      • Capturing images with TRIK camera and using them in TRIK Studio
      • Working with battery and charger
  • LEGO EV3 Controller
    • About LEGO EV3
    • Connecting a LEGO EV3 Controller to TRIK Studio
    • LEGO EV3 specific blocks
    • Sensory Variables for the LEGO EV3 Controller
    • Launching and uploading programs to the LEGO EV3
  • LEGO NXT Controller
    • About LEGO NXT
    • LEGO NXT Controller Firmware
    • Connecting a LEGO NXT Controller to TRIK Studio
    • LEGO NXT specific blocks
    • Sensory Variables for the LEGO NXT Controller
    • LEGO NXT C Programming
    • Launching and uploading programs to the LEGO NXT
  • Quadcopter Geoscan Pioneer
    • About quadcopter Geoscan Pioneer
    • Geoscan Pioneer specific blocks
  • TRIK Gamepad
    • About TRIK Gamepad
      • TRIK Gamepad App
      • TRIK Gamepad Utility
    • Robot control from the remote control
  • Feedback
    • Actions in case of TRIK Studio or TRIK controller malfunction
    • Ask a Question
    • trikset.com
Powered by GitBook
On this page
  • calibrate
  • calibrationFinished
  • getCalibrationValues
  • isCalibrated
  • newData
  • read
  • readRawData
  • setCalibrationValues

Was this helpful?

Export as PDF
  1. TRIK controller
  2. TRIK controller programming in Python and JavaScript
  3. Object «brick»

Class «gyroscope»

PreviousClass «encoder»NextClass «keys»

Last updated 4 years ago

Was this helpful?

This article is automatically translated from Russian by Google Translator.

Represents of the TRIK controller. At rest, the average value of the gyroscope output is not zero and is called a bias or bias error.

The parameter is determined by many factors and can vary, for example, depending on the ambient temperature.

In order for the gyroscope to work properly it is necessary to subtract the zero offset from the incoming values. This can be calculated using the "" method.

Since calibration takes a long time, if you run the model frequently, you can do it once, then store the value in a variable with "", and call "" instead of calibration when you run the program.

Method

Description

Calculates a zero offset within a specified time and initializes the gyroscope with this parameter, resets the current tilt angles.

Returns an object that contains the necessary zero-offset data.

Returns true if calibration is complete, false otherwise.

Returns an array of seven elements: angular velocities on the three axes, time of the last measurement, tilt angles on the three axes.

Returns an array of three elements with angular velocities on the three axes.

Sets the object containing the necessary parameters about the zero offset.

Сигнал

Описание

The signal sent by the sensor after the end of the calibration.

The signal sent by the sensor when it has new data ready.

calibrate

Calculates a zero offset within a specified time and initializes the gyroscope with this parameter, resets the current tilt angles. The recommended calibration time is 10-20 seconds.

Syntax

brick.gyroscope().calibrate(msec);
brick.gyroscope().calibrate(msec);

Parameter:

  • msec — time in milliseconds.

calibrationFinished

The signal sent by the sensor after the end of the calibration.

getCalibrationValues

Returns an object that contains the necessary zero-offset data.

Syntax

brick.gyroscope().getCalibrationValues();
brick.gyroscope().getCalibrationValues();

isCalibrated

Returns true if calibration is complete, false otherwise.

Syntax

brick.gyroscope().isCalibrated();
brick.gyroscope().isCalibrated();

newData

The signal sent by the sensor when it has new data ready.

read

Returns an array of seven elements:

  • 0−2 — angular velocities on the three axes (in milligrades/seconds),

  • 3 — a time of the last measurement (in microseconds),

  • 4−6 — tilt angles on the three axes (in milligrads).

Syntax

brick.gyroscope().read();
brick.gyroscope().read();

readRawData

Returns an array of three elements with angular velocities on the three axes.

Syntax

brick.gyroscope().readRawData();
brick.gyroscope().readRawData();

setCalibrationValues

Sets the object containing the necessary parameters about the zero offset.

Syntax

brick.gyroscope().setCalibrationValues(values);
brick.gyroscope().setCalibrationValues(values);

Parameter:

  • values — object containing bias data.

Since calibration takes a long time, if you run the model frequently, you can do it once, then store the value in a variable with "", and call "setCalibrationValues" instead of calibration when you run the program.

getCalibrationVaules
calibrate
getCalibrationValues
isCalibrated
read
readRawData
setCalibrationValues
calibrationFinished
newData
calibrate
getCalibrationVaules
setCalibrationValues
the gyroscope