You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This constructor sets the variables to the following values:
98
100
101
+
:param str config_file_path = "/home/pi/Dexter/gpg3_config.json": Path to JSON config file that stores the wheel diameter and wheel base width for the GoPiGo3.
99
102
:param bool use_mutex = False: When using multiple threads/processes that access the same resource/device, mutex has to be enabled.
100
103
:var int speed = 300: The speed of the motors should go between **0-1000** DPS.
101
104
:var tuple(int,int,int) left_eye_color = (0,255,255): Set Dex's left eye color to **turqoise**.
:raises gopigo3.FirmwareVersionError: If the GoPiGo3 firmware needs to be updated. It also debugs a message in the terminal.
106
109
:raises Exception: For any other kind of exceptions.
107
110
111
+
The ``config_file_path`` parameter represents the path to a JSON file. The presence of this configuration file is optional and is only required in cases where
112
+
the GoPiGo3 has a skewed trajectory due to minor differences in these two constants: the **wheel diameter** and the **wheel base width**. In most cases, this won't be the case.
113
+
114
+
By-default, the constructor tries to read the ``config_file_path`` file and silently fails if something goes wrong: wrong permissions, non-existent file, improper key values and so on.
115
+
To set custom values to these 2 constants, use :py:meth:`~easygopigo3.EasyGoPiGo3.set_robot_constants` method and for saving the constants to a file call
Load wheel diameter and wheel base width constants for the GoPiGo3 from file.
149
+
150
+
This method gets called by the constructor.
151
+
152
+
:param str config_file_path = "/home/pi/Dexter/gpg3_config.json": Path to JSON config file that stores the wheel diameter and wheel base width for the GoPiGo3.
153
+
:raises FileNotFoundError: When the file is non-existent.
154
+
:raises KeyError: If one of the keys is not part of the dictionary.
155
+
:raises ValueError: If the saved values are not positive numbers (floats or ints).
156
+
:raises TypeError: If the saved values are not numbers.
157
+
:raises IOError: When the file cannot be accessed.
158
+
:raises PermissionError: When there are not enough permissions to access the file.
159
+
160
+
Here's how the JSON config file must look like before reading it. Obviously, the supported format is JSON so that anyone can come in
161
+
and edit their own config file if they don't want to go through saving the values by using the API.
Save the current wheel diameter and wheel base width constants (from within this object's context) for the GoPiGo3 to file for future use.
181
+
182
+
:param str config_file_path = "/home/pi/Dexter/gpg3_config.json": Path to JSON config file that stores the wheel diameter and wheel base width for the GoPiGo3.
183
+
:raises IOError: When the file cannot be accessed.
184
+
:raises PermissionError: When there are not enough permissions to create the file.
185
+
186
+
Here's how the JSON config file will end up looking like. The values can differ from case to case.
0 commit comments