Motion referenceing with the use of a 9-DOF IMU. Accelerometer, Gyro and Magnetometer
In order to build the Python module download RTIMULib2 and follow the instructions from RTIMULib2/Linux/python/README.md
Then install sql-connector-python with a pip install
sudo apt install python3-pip # if pip is not installed
pip3 install mysql-connector-python
-
Enable other devices to connect to the database
-
This is done by editing the bind-address from 127.0.0.1 to 0.0.0.0 within the mysqld.cnf file, default located at:
/etc/mysql/mysql.conf.d/my
-
-
Create a user with From host: %
CREATE TABLE `imu_data`.`test_table` (
`idtestTable2` INT NOT NULL,
`accel_x` INT NULL,
`accel_y` INT NULL,
`time_entry` TIMESTAMP(3) NULL,
PRIMARY KEY (`idtestTable2`));
SELECT User, Host, authentication_string FROM mysql.user;
SHOW DATABASES;
INSERT INTO mysql.user (User,Host,authentication_string,ssl_cipher,x509_issuer,x509_subject) VALUES('rrai','%',PASSWORD('redrock1234'),'','','');
USE name_of_database;
SHOW TABLES;
SHOW VARIABLES LIKE 'validate_password%';
SET GLOBAL validate_password_length = 6;
SET GLOBAL validate_password_number_count = 0;
GRANT SELECT, INSERT, SHOW DATABASES ON imu_data.* TO user_name@'%';
GRANT GRANT OPTION ON *.* TO user_name@'%';
GRANT ALL PRIVILEGES ON *.* TO user_name@'%';
# If the following lines are necessary tests them one at a time as listed
GRANT SUPER ON *.* TO rrai@'%'; (Not sure if this one is neccesray)
UPDATE mysql.user SET Super_Priv='Y' WHERE user='rrai' AND host='%'; (Not sure if this one is neccessary)
If a quary of a single value is wanted as in for example:
# sql_string = "INSERT INTO `test`.`time_test_table` (`TimeStamp_e`) VALUES (%s)"
The value passed has to be made into a tuple, as shown below:
data = 1
cursor.execute(sql_string, (data, ))
Instead of
cursor.execute(sql_string, data)
Indent with markdown:
python mysql insert
mySQL terminal command lines
SQL role PRIVILEGES
python matlibplot Plot with timestamp
UR gripper
UR ROS-driver
UR ROS python "urx"
UR python real time face tracking
UR python socket
Python Ros URSim