Created
November 5, 2024 06:08
-
-
Save haixuanTao/3c4675372df4c71cff86be628a5eda79 to your computer and use it in GitHub Desktop.
read piper data
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
from piper_sdk import * | |
piper_left = C_PiperInterface("can_left") | |
piper_left.ConnectPort() | |
piper_right = C_PiperInterface("can_right") | |
piper_right.ConnectPort() | |
joint_left = piper_left.GetArmJointMsgs() | |
joint_right = piper_right.GetArmJointMsgs() | |
factor = 57324.840764 #1000*180/3.14 | |
joint_left_value = [] | |
joint_left_value += [joint_left.joint_state.joint_0 / factor] | |
joint_left_value += [joint_left.joint_state.joint_1 / factor] | |
joint_left_value += [joint_left.joint_state.joint_2 / factor] | |
joint_left_value += [joint_left.joint_state.joint_3 / factor] | |
joint_left_value += [joint_left.joint_state.joint_4 / factor] | |
joint_left_value += [joint_left.joint_state.joint_5 / factor] | |
joint_left_value += [joint_left.joint_state.joint_6 / factor] | |
joint_right_value = [] | |
joint_right_value += [joint_right.joint_state.joint_0 / factor] | |
joint_right_value += [joint_right.joint_state.joint_1 / factor] | |
joint_right_value += [joint_right.joint_state.joint_2 / factor] | |
joint_right_value += [joint_right.joint_state.joint_3 / factor] | |
joint_right_value += [joint_right.joint_state.joint_4 / factor] | |
joint_right_value += [joint_right.joint_state.joint_5 / factor] | |
joint_right_value += [joint_right.joint_state.joint_6 / factor] | |
print(joint_left_value) | |
print(joint_right_value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment