From a46a95092cdb337496ffb66eae6d089be8d33b76 Mon Sep 17 00:00:00 2001 From: Benathen <57081234+bentheperson1@users.noreply.github.com> Date: Mon, 13 May 2024 21:18:12 -0500 Subject: [PATCH] Typos Fix typos in sport client constants and channel factory --- example/front_camera/camera_opencv.py | 6 +- example/front_camera/capture_image.py | 6 +- example/helloworld/publisher.py | 4 +- example/helloworld/subscriber.py | 4 +- example/high_level/read_highstate.py | 4 +- example/high_level/sportmode_test.py | 6 +- example/low_level/lowlevel_control.py | 8 +- example/low_level/read_lowstate.py | 6 +- .../obstacles_avoid_switch.py | 6 +- example/vui_client/vui_client_example.py | 6 +- .../wireless_controller.py | 6 +- unitree_sdk2py/core/channel.py | 4 +- unitree_sdk2py/go2/sport/sport_api.py | 74 ++++----- unitree_sdk2py/go2/sport/sport_client.py | 142 +++++++++--------- .../client/obstacles_avoid_client_example.py | 4 +- .../client/robot_service_client_example.py | 4 +- .../test/client/sport_client_example.py | 4 +- .../test/client/video_client_example.py | 4 +- .../test/client/vui_client_example.py | 4 +- unitree_sdk2py/test/helloworld/publisher.py | 4 +- unitree_sdk2py/test/helloworld/subscriber.py | 4 +- .../test/lowlevel/lowlevel_control.py | 6 +- unitree_sdk2py/test/lowlevel/read_lowstate.py | 4 +- unitree_sdk2py/test/lowlevel/sub_lowstate.py | 4 +- .../test/rpc/test_client_example.py | 4 +- .../test/rpc/test_server_example.py | 4 +- 26 files changed, 166 insertions(+), 166 deletions(-) diff --git a/example/front_camera/camera_opencv.py b/example/front_camera/camera_opencv.py index c9fd2c5..9d98839 100644 --- a/example/front_camera/camera_opencv.py +++ b/example/front_camera/camera_opencv.py @@ -1,4 +1,4 @@ -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.video.video_client import VideoClient import cv2 import numpy as np @@ -7,9 +7,9 @@ import sys if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) client = VideoClient() # Create a video client client.SetTimeout(3.0) diff --git a/example/front_camera/capture_image.py b/example/front_camera/capture_image.py index 3bd3aea..1e85643 100644 --- a/example/front_camera/capture_image.py +++ b/example/front_camera/capture_image.py @@ -2,14 +2,14 @@ import time import os import sys -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.video.video_client import VideoClient if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) client = VideoClient() client.SetTimeout(3.0) diff --git a/example/helloworld/publisher.py b/example/helloworld/publisher.py index dae94ae..cfe4f1f 100644 --- a/example/helloworld/publisher.py +++ b/example/helloworld/publisher.py @@ -1,11 +1,11 @@ import time -from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactoryInitialize from user_data import * if __name__ == "__main__": - ChannelFactortyInitialize() + ChannelFactoryInitialize() # Create a publisher to publish the data defined in UserData class pub = ChannelPublisher("topic", UserData) diff --git a/example/helloworld/subscriber.py b/example/helloworld/subscriber.py index bf6c6bd..a7d0b63 100644 --- a/example/helloworld/subscriber.py +++ b/example/helloworld/subscriber.py @@ -1,11 +1,11 @@ import time -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from user_data import * if __name__ == "__main__": - ChannelFactortyInitialize() + ChannelFactoryInitialize() # Create a subscriber to subscribe the data defined in UserData class sub = ChannelSubscriber("topic", UserData) sub.Init() diff --git a/example/high_level/read_highstate.py b/example/high_level/read_highstate.py index 54a4d3f..ba43a76 100644 --- a/example/high_level/read_highstate.py +++ b/example/high_level/read_highstate.py @@ -1,6 +1,6 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__SportModeState_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import SportModeState_ @@ -15,7 +15,7 @@ def HighStateHandler(msg: SportModeState_): if __name__ == "__main__": - ChannelFactortyInitialize(0, "enp3s0") + ChannelFactoryInitialize(0, "enp3s0") sub = ChannelSubscriber("rt/sportmodestate", SportModeState_) sub.Init(HighStateHandler, 10) diff --git a/example/high_level/sportmode_test.py b/example/high_level/sportmode_test.py index 026b27b..845ddc5 100644 --- a/example/high_level/sportmode_test.py +++ b/example/high_level/sportmode_test.py @@ -1,6 +1,6 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__SportModeState_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import SportModeState_ from unitree_sdk2py.go2.sport.sport_client import ( @@ -120,9 +120,9 @@ def HighStateHandler(msg: SportModeState_): if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) sub = ChannelSubscriber("rt/sportmodestate", SportModeState_) sub.Init(HighStateHandler, 10) diff --git a/example/low_level/lowlevel_control.py b/example/low_level/lowlevel_control.py index 7b0859a..638c5f2 100644 --- a/example/low_level/lowlevel_control.py +++ b/example/low_level/lowlevel_control.py @@ -1,8 +1,8 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactortyInitialize -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactoryInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__LowCmd_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import LowCmd_ from unitree_sdk2py.utils.crc import CRC @@ -14,9 +14,9 @@ crc = CRC() if __name__ == '__main__': if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) # Create a publisher to publish the data defined in UserData class pub = ChannelPublisher("rt/lowcmd", LowCmd_) pub.Init() diff --git a/example/low_level/read_lowstate.py b/example/low_level/read_lowstate.py index bf2ac5b..8653822 100644 --- a/example/low_level/read_lowstate.py +++ b/example/low_level/read_lowstate.py @@ -1,6 +1,6 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__LowState_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import LowState_ @@ -17,9 +17,9 @@ def LowStateHandler(msg: LowState_): if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) sub = ChannelSubscriber("rt/lowstate", LowState_) sub.Init(LowStateHandler, 10) diff --git a/example/obstacles_avoid_switch/obstacles_avoid_switch.py b/example/obstacles_avoid_switch/obstacles_avoid_switch.py index 5dcb718..eb345c0 100644 --- a/example/obstacles_avoid_switch/obstacles_avoid_switch.py +++ b/example/obstacles_avoid_switch/obstacles_avoid_switch.py @@ -1,14 +1,14 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.obstacles_avoid.obstacles_avoid_client import ObstaclesAvoidClient if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) client = ObstaclesAvoidClient() client.SetTimeout(3.0) diff --git a/example/vui_client/vui_client_example.py b/example/vui_client/vui_client_example.py index a06f8e3..a5e6932 100644 --- a/example/vui_client/vui_client_example.py +++ b/example/vui_client/vui_client_example.py @@ -1,14 +1,14 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.vui.vui_client import VuiClient if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) client = VuiClient() client.SetTimeout(3.0) diff --git a/example/wireless_controller/wireless_controller.py b/example/wireless_controller/wireless_controller.py index b468daf..0596d1a 100644 --- a/example/wireless_controller/wireless_controller.py +++ b/example/wireless_controller/wireless_controller.py @@ -1,6 +1,6 @@ import time import sys -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__WirelessController_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import WirelessController_ @@ -44,9 +44,9 @@ def WirelessControllerHandler(msg: WirelessController_): if __name__ == "__main__": if len(sys.argv)>1: - ChannelFactortyInitialize(0, sys.argv[1]) + ChannelFactoryInitialize(0, sys.argv[1]) else: - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) sub = ChannelSubscriber("rt/wirelesscontroller", WirelessController_) sub.Init(WirelessControllerHandler, 10) diff --git a/unitree_sdk2py/core/channel.py b/unitree_sdk2py/core/channel.py index 6dfa2e1..d955f75 100644 --- a/unitree_sdk2py/core/channel.py +++ b/unitree_sdk2py/core/channel.py @@ -282,9 +282,9 @@ class ChannelSubscriber: return self.__channel.Read(timeout) """ -" function ChannelFactortyInitialize. used to intialize channel everenment. +" function ChannelFactoryInitialize. used to intialize channel everenment. """ -def ChannelFactortyInitialize(id: int = 0, networkInterface: str = None): +def ChannelFactoryInitialize(id: int = 0, networkInterface: str = None): factory = ChannelFactory() if not factory.Init(id, networkInterface): raise Exception("channel factory init error.") diff --git a/unitree_sdk2py/go2/sport/sport_api.py b/unitree_sdk2py/go2/sport/sport_api.py index 5e68581..c399031 100644 --- a/unitree_sdk2py/go2/sport/sport_api.py +++ b/unitree_sdk2py/go2/sport/sport_api.py @@ -13,42 +13,42 @@ SPORT_API_VERSION = "1.0.0.1" """ " api id """ -SPROT_API_ID_DAMP = 1001 -SPROT_API_ID_BALANCESTAND = 1002 -SPROT_API_ID_STOPMOVE = 1003 -SPROT_API_ID_STANDUP = 1004 -SPROT_API_ID_STANDDOWN = 1005 -SPROT_API_ID_RECOVERYSTAND = 1006 -SPROT_API_ID_EULER = 1007 -SPROT_API_ID_MOVE = 1008 -SPROT_API_ID_SIT = 1009 -SPROT_API_ID_RISESIT = 1010 -SPROT_API_ID_SWITCHGAIT = 1011 -SPROT_API_ID_TRIGGER = 1012 -SPROT_API_ID_BODYHEIGHT = 1013 -SPROT_API_ID_FOOTRAISEHEIGHT = 1014 -SPROT_API_ID_SPEEDLEVEL = 1015 -SPROT_API_ID_HELLO = 1016 -SPROT_API_ID_STRETCH = 1017 -SPROT_API_ID_TRAJECTORYFOLLOW = 1018 -SPROT_API_ID_CONTINUOUSGAIT = 1019 -SPROT_API_ID_CONTENT = 1020 -SPROT_API_ID_WALLOW = 1021 -SPROT_API_ID_DANCE1 = 1022 -SPROT_API_ID_DANCE2 = 1023 -SPROT_API_ID_GETBODYHEIGHT = 1024 -SPROT_API_ID_GETFOOTRAISEHEIGHT = 1025 -SPROT_API_ID_GETSPEEDLEVEL = 1026 -SPROT_API_ID_SWITCHJOYSTICK = 1027 -SPROT_API_ID_POSE = 1028 -SPROT_API_ID_SCRAPE = 1029 -SPROT_API_ID_FRONTFLIP = 1030 -SPROT_API_ID_FRONTJUMP = 1031 -SPROT_API_ID_FRONTPOUNCE = 1032 -SPROT_API_ID_WIGGLEHIPS = 1033 -SPROT_API_ID_GETSTATE = 1034 -SPROT_API_ID_ECONOMICGAIT = 1035 -SPROT_API_ID_HEART = 1036 +SPORT_API_ID_DAMP = 1001 +SPORT_API_ID_BALANCESTAND = 1002 +SPORT_API_ID_STOPMOVE = 1003 +SPORT_API_ID_STANDUP = 1004 +SPORT_API_ID_STANDDOWN = 1005 +SPORT_API_ID_RECOVERYSTAND = 1006 +SPORT_API_ID_EULER = 1007 +SPORT_API_ID_MOVE = 1008 +SPORT_API_ID_SIT = 1009 +SPORT_API_ID_RISESIT = 1010 +SPORT_API_ID_SWITCHGAIT = 1011 +SPORT_API_ID_TRIGGER = 1012 +SPORT_API_ID_BODYHEIGHT = 1013 +SPORT_API_ID_FOOTRAISEHEIGHT = 1014 +SPORT_API_ID_SPEEDLEVEL = 1015 +SPORT_API_ID_HELLO = 1016 +SPORT_API_ID_STRETCH = 1017 +SPORT_API_ID_TRAJECTORYFOLLOW = 1018 +SPORT_API_ID_CONTINUOUSGAIT = 1019 +SPORT_API_ID_CONTENT = 1020 +SPORT_API_ID_WALLOW = 1021 +SPORT_API_ID_DANCE1 = 1022 +SPORT_API_ID_DANCE2 = 1023 +SPORT_API_ID_GETBODYHEIGHT = 1024 +SPORT_API_ID_GETFOOTRAISEHEIGHT = 1025 +SPORT_API_ID_GETSPEEDLEVEL = 1026 +SPORT_API_ID_SWITCHJOYSTICK = 1027 +SPORT_API_ID_POSE = 1028 +SPORT_API_ID_SCRAPE = 1029 +SPORT_API_ID_FRONTFLIP = 1030 +SPORT_API_ID_FRONTJUMP = 1031 +SPORT_API_ID_FRONTPOUNCE = 1032 +SPORT_API_ID_WIGGLEHIPS = 1033 +SPORT_API_ID_GETSTATE = 1034 +SPORT_API_ID_ECONOMICGAIT = 1035 +SPORT_API_ID_HEART = 1036 """ @@ -58,4 +58,4 @@ SPROT_API_ID_HEART = 1036 SPORT_ERR_CLIENT_POINT_PATH = 4101 # server side SPORT_ERR_SERVER_OVERTIME = 4201 -SPROT_ERR_SERVER_NOT_INIT = 4202 +SPORT_ERR_SERVER_NOT_INIT = 4202 diff --git a/unitree_sdk2py/go2/sport/sport_client.py b/unitree_sdk2py/go2/sport/sport_client.py index 5518dbc..8fea8b8 100644 --- a/unitree_sdk2py/go2/sport/sport_client.py +++ b/unitree_sdk2py/go2/sport/sport_client.py @@ -36,83 +36,83 @@ class SportClient(Client): self._SetApiVerson(SPORT_API_VERSION) # regist api - self._RegistApi(SPROT_API_ID_DAMP, 0) - self._RegistApi(SPROT_API_ID_BALANCESTAND, 0) - self._RegistApi(SPROT_API_ID_STOPMOVE, 0) - self._RegistApi(SPROT_API_ID_STANDUP, 0) - self._RegistApi(SPROT_API_ID_STANDDOWN, 0) - self._RegistApi(SPROT_API_ID_RECOVERYSTAND, 0) - self._RegistApi(SPROT_API_ID_EULER, 0) - self._RegistApi(SPROT_API_ID_MOVE, 0) - self._RegistApi(SPROT_API_ID_SIT, 0) - self._RegistApi(SPROT_API_ID_RISESIT, 0) - self._RegistApi(SPROT_API_ID_SWITCHGAIT, 0) - self._RegistApi(SPROT_API_ID_TRIGGER, 0) - self._RegistApi(SPROT_API_ID_BODYHEIGHT, 0) - self._RegistApi(SPROT_API_ID_FOOTRAISEHEIGHT, 0) - self._RegistApi(SPROT_API_ID_SPEEDLEVEL, 0) - self._RegistApi(SPROT_API_ID_HELLO, 0) - self._RegistApi(SPROT_API_ID_STRETCH, 0) - self._RegistApi(SPROT_API_ID_TRAJECTORYFOLLOW, 0) - self._RegistApi(SPROT_API_ID_CONTINUOUSGAIT, 0) - # self._RegistApi(SPROT_API_ID_CONTENT, 0) - self._RegistApi(SPROT_API_ID_WALLOW, 0) - self._RegistApi(SPROT_API_ID_DANCE1, 0) - self._RegistApi(SPROT_API_ID_DANCE2, 0) - # self._RegistApi(SPROT_API_ID_GETBODYHEIGHT, 0) - # self._RegistApi(SPROT_API_ID_GETFOOTRAISEHEIGHT, 0) - # self._RegistApi(SPROT_API_ID_GETSPEEDLEVEL, 0) - self._RegistApi(SPROT_API_ID_SWITCHJOYSTICK, 0) - self._RegistApi(SPROT_API_ID_POSE, 0) - self._RegistApi(SPROT_API_ID_SCRAPE, 0) - self._RegistApi(SPROT_API_ID_FRONTFLIP, 0) - self._RegistApi(SPROT_API_ID_FRONTJUMP, 0) - self._RegistApi(SPROT_API_ID_FRONTPOUNCE, 0) - self._RegistApi(SPROT_API_ID_WIGGLEHIPS, 0) - self._RegistApi(SPROT_API_ID_GETSTATE, 0) - self._RegistApi(SPROT_API_ID_ECONOMICGAIT, 0) - self._RegistApi(SPROT_API_ID_HEART, 0) + self._RegistApi(SPORT_API_ID_DAMP, 0) + self._RegistApi(SPORT_API_ID_BALANCESTAND, 0) + self._RegistApi(SPORT_API_ID_STOPMOVE, 0) + self._RegistApi(SPORT_API_ID_STANDUP, 0) + self._RegistApi(SPORT_API_ID_STANDDOWN, 0) + self._RegistApi(SPORT_API_ID_RECOVERYSTAND, 0) + self._RegistApi(SPORT_API_ID_EULER, 0) + self._RegistApi(SPORT_API_ID_MOVE, 0) + self._RegistApi(SPORT_API_ID_SIT, 0) + self._RegistApi(SPORT_API_ID_RISESIT, 0) + self._RegistApi(SPORT_API_ID_SWITCHGAIT, 0) + self._RegistApi(SPORT_API_ID_TRIGGER, 0) + self._RegistApi(SPORT_API_ID_BODYHEIGHT, 0) + self._RegistApi(SPORT_API_ID_FOOTRAISEHEIGHT, 0) + self._RegistApi(SPORT_API_ID_SPEEDLEVEL, 0) + self._RegistApi(SPORT_API_ID_HELLO, 0) + self._RegistApi(SPORT_API_ID_STRETCH, 0) + self._RegistApi(SPORT_API_ID_TRAJECTORYFOLLOW, 0) + self._RegistApi(SPORT_API_ID_CONTINUOUSGAIT, 0) + # self._RegistApi(SPORT_API_ID_CONTENT, 0) + self._RegistApi(SPORT_API_ID_WALLOW, 0) + self._RegistApi(SPORT_API_ID_DANCE1, 0) + self._RegistApi(SPORT_API_ID_DANCE2, 0) + # self._RegistApi(SPORT_API_ID_GETBODYHEIGHT, 0) + # self._RegistApi(SPORT_API_ID_GETFOOTRAISEHEIGHT, 0) + # self._RegistApi(SPORT_API_ID_GETSPEEDLEVEL, 0) + self._RegistApi(SPORT_API_ID_SWITCHJOYSTICK, 0) + self._RegistApi(SPORT_API_ID_POSE, 0) + self._RegistApi(SPORT_API_ID_SCRAPE, 0) + self._RegistApi(SPORT_API_ID_FRONTFLIP, 0) + self._RegistApi(SPORT_API_ID_FRONTJUMP, 0) + self._RegistApi(SPORT_API_ID_FRONTPOUNCE, 0) + self._RegistApi(SPORT_API_ID_WIGGLEHIPS, 0) + self._RegistApi(SPORT_API_ID_GETSTATE, 0) + self._RegistApi(SPORT_API_ID_ECONOMICGAIT, 0) + self._RegistApi(SPORT_API_ID_HEART, 0) # 1001 def Damp(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_DAMP, parameter) + code, data = self._Call(SPORT_API_ID_DAMP, parameter) return code # 1002 def BalanceStand(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_BALANCESTAND, parameter) + code, data = self._Call(SPORT_API_ID_BALANCESTAND, parameter) return code # 1003 def StopMove(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_STOPMOVE, parameter) + code, data = self._Call(SPORT_API_ID_STOPMOVE, parameter) return code # 1004 def StandUp(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_STANDUP, parameter) + code, data = self._Call(SPORT_API_ID_STANDUP, parameter) return code # 1005 def StandDown(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_STANDDOWN, parameter) + code, data = self._Call(SPORT_API_ID_STANDDOWN, parameter) return code # 1006 def RecoveryStand(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_RECOVERYSTAND, parameter) + code, data = self._Call(SPORT_API_ID_RECOVERYSTAND, parameter) return code # 1007 @@ -122,7 +122,7 @@ class SportClient(Client): p["y"] = pitch p["z"] = yaw parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_EULER, parameter) + code, data = self._Call(SPORT_API_ID_EULER, parameter) return code # 1008 @@ -132,21 +132,21 @@ class SportClient(Client): p["y"] = vy p["z"] = vyaw parameter = json.dumps(p) - code = self._CallNoReply(SPROT_API_ID_MOVE, parameter) + code = self._CallNoReply(SPORT_API_ID_MOVE, parameter) return code # 1009 def Sit(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_SIT, parameter) + code, data = self._Call(SPORT_API_ID_SIT, parameter) return code #1010 def RiseSit(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_RISESIT, parameter) + code, data = self._Call(SPORT_API_ID_RISESIT, parameter) return code # 1011 @@ -154,14 +154,14 @@ class SportClient(Client): p = {} p["data"] = t parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_SWITCHGAIT, parameter) + code, data = self._Call(SPORT_API_ID_SWITCHGAIT, parameter) return code # 1012 def Trigger(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_TRIGGER, parameter) + code, data = self._Call(SPORT_API_ID_TRIGGER, parameter) return code # 1013 @@ -169,7 +169,7 @@ class SportClient(Client): p = {} p["data"] = height parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_BODYHEIGHT, parameter) + code, data = self._Call(SPORT_API_ID_BODYHEIGHT, parameter) return code # 1014 @@ -177,7 +177,7 @@ class SportClient(Client): p = {} p["data"] = height parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_FOOTRAISEHEIGHT, parameter) + code, data = self._Call(SPORT_API_ID_FOOTRAISEHEIGHT, parameter) return code # 1015 @@ -185,21 +185,21 @@ class SportClient(Client): p = {} p["data"] = level parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_SPEEDLEVEL, parameter) + code, data = self._Call(SPORT_API_ID_SPEEDLEVEL, parameter) return code # 1016 def Hello(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_HELLO, parameter) + code, data = self._Call(SPORT_API_ID_HELLO, parameter) return code # 1017 def Stretch(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_STRETCH, parameter) + code, data = self._Call(SPORT_API_ID_STRETCH, parameter) return code # 1018 @@ -222,7 +222,7 @@ class SportClient(Client): path_p.append(p) parameter = json.dumps(path_p) - code = self._CallNoReply(SPROT_API_ID_TRAJECTORYFOLLOW, parameter) + code = self._CallNoReply(SPORT_API_ID_TRAJECTORYFOLLOW, parameter) return code # 1019 @@ -230,35 +230,35 @@ class SportClient(Client): p = {} p["data"] = flag parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_CONTINUOUSGAIT, parameter) + code, data = self._Call(SPORT_API_ID_CONTINUOUSGAIT, parameter) return code # # 1020 # def Content(self): # p = {} # parameter = json.dumps(p) - # code, data = self._Call(SPROT_API_ID_CONTENT, parameter) + # code, data = self._Call(SPORT_API_ID_CONTENT, parameter) # return code # 1021 def Wallow(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_WALLOW, parameter) + code, data = self._Call(SPORT_API_ID_WALLOW, parameter) return code # 1022 def Dance1(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_DANCE1, parameter) + code, data = self._Call(SPORT_API_ID_DANCE1, parameter) return code # 1023 def Dance2(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_DANCE2, parameter) + code, data = self._Call(SPORT_API_ID_DANCE2, parameter) return code # 1025 @@ -266,7 +266,7 @@ class SportClient(Client): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_GETFOOTRAISEHEIGHT, parameter) + code, data = self._Call(SPORT_API_ID_GETFOOTRAISEHEIGHT, parameter) if code == 0: d = json.loads(data) @@ -280,7 +280,7 @@ class SportClient(Client): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_GETSPEEDLEVEL, parameter) + code, data = self._Call(SPORT_API_ID_GETSPEEDLEVEL, parameter) if code == 0: d = json.loads(data) @@ -293,7 +293,7 @@ class SportClient(Client): p = {} p["data"] = on parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_SWITCHJOYSTICK, parameter) + code, data = self._Call(SPORT_API_ID_SWITCHJOYSTICK, parameter) return code # 1028 @@ -301,48 +301,48 @@ class SportClient(Client): p = {} p["data"] = flag parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_POSE, parameter) + code, data = self._Call(SPORT_API_ID_POSE, parameter) return code # 1029 def Scrape(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_SCRAPE, parameter) + code, data = self._Call(SPORT_API_ID_SCRAPE, parameter) return code # 1030 def FrontFlip(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_FRONTFLIP, parameter) + code, data = self._Call(SPORT_API_ID_FRONTFLIP, parameter) return code # 1031 def FrontJump(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_FRONTJUMP, parameter) + code, data = self._Call(SPORT_API_ID_FRONTJUMP, parameter) return code # 1032 def FrontPounce(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_FRONTPOUNCE, parameter) + code, data = self._Call(SPORT_API_ID_FRONTPOUNCE, parameter) return code # 1033 def WiggleHips(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_WIGGLEHIPS, parameter) + code, data = self._Call(SPORT_API_ID_WIGGLEHIPS, parameter) return code # 1034 def GetState(self, keys: list): parameter = json.dumps(keys) - code, data = self._Call(SPROT_API_ID_GETSTATE, parameter) + code, data = self._Call(SPORT_API_ID_GETSTATE, parameter) if code == 0: return code, json.loads(data) else: @@ -353,12 +353,12 @@ class SportClient(Client): p = {} p["data"] = flag parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_ECONOMICGAIT, parameter) + code, data = self._Call(SPORT_API_ID_ECONOMICGAIT, parameter) return code # 1036 def Heart(self): p = {} parameter = json.dumps(p) - code, data = self._Call(SPROT_API_ID_HEART, parameter) + code, data = self._Call(SPORT_API_ID_HEART, parameter) return code \ No newline at end of file diff --git a/unitree_sdk2py/test/client/obstacles_avoid_client_example.py b/unitree_sdk2py/test/client/obstacles_avoid_client_example.py index a8f5596..7936fe7 100644 --- a/unitree_sdk2py/test/client/obstacles_avoid_client_example.py +++ b/unitree_sdk2py/test/client/obstacles_avoid_client_example.py @@ -1,11 +1,11 @@ import time import os -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.obstacles_avoid.obstacles_avoid_client import ObstaclesAvoidClient if __name__ == "__main__": - ChannelFactortyInitialize(0, "enp3s0") + ChannelFactoryInitialize(0, "enp3s0") client = ObstaclesAvoidClient() client.SetTimeout(3.0) diff --git a/unitree_sdk2py/test/client/robot_service_client_example.py b/unitree_sdk2py/test/client/robot_service_client_example.py index 50a16b3..01467c0 100644 --- a/unitree_sdk2py/test/client/robot_service_client_example.py +++ b/unitree_sdk2py/test/client/robot_service_client_example.py @@ -1,9 +1,9 @@ import time -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.robot_state.robot_state_client import RobotStateClient if __name__ == "__main__": - ChannelFactortyInitialize(0, "enx000ec6768747") + ChannelFactoryInitialize(0, "enx000ec6768747") rsc = RobotStateClient() rsc.SetTimeout(3.0) rsc.Init() diff --git a/unitree_sdk2py/test/client/sport_client_example.py b/unitree_sdk2py/test/client/sport_client_example.py index c9132f8..22a8de0 100644 --- a/unitree_sdk2py/test/client/sport_client_example.py +++ b/unitree_sdk2py/test/client/sport_client_example.py @@ -1,9 +1,9 @@ import time -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.sport.sport_client import SportClient, PathPoint, SPORT_PATH_POINT_SIZE if __name__ == "__main__": - ChannelFactortyInitialize(0, "enp2s0") + ChannelFactoryInitialize(0, "enp2s0") client = SportClient() client.SetTimeout(10.0) client.Init() diff --git a/unitree_sdk2py/test/client/video_client_example.py b/unitree_sdk2py/test/client/video_client_example.py index d29cdaa..7eec949 100644 --- a/unitree_sdk2py/test/client/video_client_example.py +++ b/unitree_sdk2py/test/client/video_client_example.py @@ -1,11 +1,11 @@ import time import os -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.video.video_client import VideoClient if __name__ == "__main__": - ChannelFactortyInitialize(0, "enp2s0") + ChannelFactoryInitialize(0, "enp2s0") client = VideoClient() client.SetTimeout(3.0) diff --git a/unitree_sdk2py/test/client/vui_client_example.py b/unitree_sdk2py/test/client/vui_client_example.py index d8e2ed8..6df7c09 100644 --- a/unitree_sdk2py/test/client/vui_client_example.py +++ b/unitree_sdk2py/test/client/vui_client_example.py @@ -1,11 +1,11 @@ import time import os -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.go2.vui.vui_client import VuiClient if __name__ == "__main__": - ChannelFactortyInitialize(0, "enp2s0") + ChannelFactoryInitialize(0, "enp2s0") client = VuiClient() client.SetTimeout(3.0) diff --git a/unitree_sdk2py/test/helloworld/publisher.py b/unitree_sdk2py/test/helloworld/publisher.py index 3ca1f6b..36e8fb8 100644 --- a/unitree_sdk2py/test/helloworld/publisher.py +++ b/unitree_sdk2py/test/helloworld/publisher.py @@ -1,9 +1,9 @@ import time -from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactoryInitialize from helloworld import HelloWorld -ChannelFactortyInitialize() +ChannelFactoryInitialize() pub = ChannelPublisher("topic", HelloWorld) pub.Init() diff --git a/unitree_sdk2py/test/helloworld/subscriber.py b/unitree_sdk2py/test/helloworld/subscriber.py index dba818d..38e4763 100644 --- a/unitree_sdk2py/test/helloworld/subscriber.py +++ b/unitree_sdk2py/test/helloworld/subscriber.py @@ -1,9 +1,9 @@ import time -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from helloworld import HelloWorld -ChannelFactortyInitialize() +ChannelFactoryInitialize() sub = ChannelSubscriber("topic", HelloWorld) sub.Init() diff --git a/unitree_sdk2py/test/lowlevel/lowlevel_control.py b/unitree_sdk2py/test/lowlevel/lowlevel_control.py index e195f1b..8e94fe1 100644 --- a/unitree_sdk2py/test/lowlevel/lowlevel_control.py +++ b/unitree_sdk2py/test/lowlevel/lowlevel_control.py @@ -1,7 +1,7 @@ import time -from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactortyInitialize -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelPublisher, ChannelFactoryInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__LowCmd_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import LowCmd_ from unitree_sdk2py.utils.crc import CRC @@ -13,7 +13,7 @@ lowCmdThreadPtr=Thread() if __name__ == '__main__': - ChannelFactortyInitialize(1, "enp2s0") + ChannelFactoryInitialize(1, "enp2s0") # Create a publisher to publish the data defined in UserData class pub = ChannelPublisher("lowcmd", LowCmd_) pub.Init() diff --git a/unitree_sdk2py/test/lowlevel/read_lowstate.py b/unitree_sdk2py/test/lowlevel/read_lowstate.py index e86831e..d3f20ca 100644 --- a/unitree_sdk2py/test/lowlevel/read_lowstate.py +++ b/unitree_sdk2py/test/lowlevel/read_lowstate.py @@ -1,5 +1,5 @@ import time -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__LowState_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import LowState_ @@ -16,7 +16,7 @@ def LowStateHandler(msg: LowState_): if __name__ == "__main__": # Modify "enp2s0" to the actual network interface - ChannelFactortyInitialize(0, "enp2s0") + ChannelFactoryInitialize(0, "enp2s0") sub = ChannelSubscriber("rt/lowstate", LowState_) sub.Init(LowStateHandler, 10) diff --git a/unitree_sdk2py/test/lowlevel/sub_lowstate.py b/unitree_sdk2py/test/lowlevel/sub_lowstate.py index dd31ee9..9a94619 100644 --- a/unitree_sdk2py/test/lowlevel/sub_lowstate.py +++ b/unitree_sdk2py/test/lowlevel/sub_lowstate.py @@ -1,5 +1,5 @@ import time -from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize from unitree_sdk2py.idl.default import unitree_go_msg_dds__LowState_ from unitree_sdk2py.idl.unitree_go.msg.dds_ import LowState_ @@ -7,7 +7,7 @@ def LowStateHandler(msg: LowState_): print(msg.motor_state) -ChannelFactortyInitialize(0, "enp2s0") +ChannelFactoryInitialize(0, "enp2s0") sub = ChannelSubscriber("rt/lowstate", LowState_) sub.Init(LowStateHandler, 10) diff --git a/unitree_sdk2py/test/rpc/test_client_example.py b/unitree_sdk2py/test/rpc/test_client_example.py index 6763267..35c6ad4 100644 --- a/unitree_sdk2py/test/rpc/test_client_example.py +++ b/unitree_sdk2py/test/rpc/test_client_example.py @@ -1,7 +1,7 @@ import time import json -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.rpc.client import Client from test_api import * @@ -37,7 +37,7 @@ class TestClient(Client): if __name__ == "__main__": # initialize channel factory. - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) # create client client = TestClient(True) diff --git a/unitree_sdk2py/test/rpc/test_server_example.py b/unitree_sdk2py/test/rpc/test_server_example.py index 3ccef8e..a929e01 100644 --- a/unitree_sdk2py/test/rpc/test_server_example.py +++ b/unitree_sdk2py/test/rpc/test_server_example.py @@ -1,7 +1,7 @@ import time import json -from unitree_sdk2py.core.channel import ChannelFactortyInitialize +from unitree_sdk2py.core.channel import ChannelFactoryInitialize from unitree_sdk2py.rpc.server import Server from test_api import * @@ -33,7 +33,7 @@ class TestServer(Server): if __name__ == "__main__": # initialize channel factory. - ChannelFactortyInitialize(0) + ChannelFactoryInitialize(0) # create server server = TestServer()