This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### This code converts the python hmdmatrix34_t equivalent that you get from pose.mDeviceToAbsoluteTracking into sort-of functioning Euler angles. | |
#### Euler angles are still Euler angles however, so be careful. | |
#From https://gist.github.com/awesomebytes/778d4a1720a0ec3af2086ff6a0b057c3 | |
def from_matrix_to_pose_dict(matrix): | |
pose = {} | |
# From http://steamcommunity.com/app/358720/discussions/0/358417008714224220/#c359543542244499836 | |
position = {} | |
position['x'] = matrix[0][3] | |
position['y'] = matrix[1][3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
ser = serial.Serial('COM11', 9600, timeout=0.5) #open the rs485 adapter | |
while True: | |
ser.write(('0010074002=?106\r').encode()) #request pressure from PPT-100, pfeiffer protocol | |
result = ser.readline() #read pressure back, use timeout | |
#return value is this: | |
#adr ac prn ty value chk r | |
#001 10 740 06 100023 025 \r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef WIN32 | |
#include <windows.h> | |
#endif | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "hidapi/hidapi.h" | |
#pragma comment(lib, "hidapi.lib") | |
#define MAX_STR 255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
BPG-400 gauge reader | |
Copyright 2022 Andrey T. | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |