add two arms to python
This commit is contained in:
parent
155b0473d3
commit
4172cad2d4
|
@ -40,8 +40,17 @@ PYBIND11_MODULE(unitree_arm_interface, m){
|
|||
.def("getQTau", &LowlevelState::getTau, rvp::reference_internal)
|
||||
;
|
||||
|
||||
py::class_<UDPPort>(m, "UDPPort")
|
||||
.def(py::init<std::string, uint, uint>(),
|
||||
py::arg("IP") = "127.0.0.1",
|
||||
py::arg("toPort") = 8071,
|
||||
py::arg("ownPort") = 8072
|
||||
)
|
||||
;
|
||||
|
||||
py::class_<CtrlComponents>(m, "CtrlComponents")
|
||||
.def_readwrite("armModel", &CtrlComponents::armModel)
|
||||
.def_readwrite("udp", &CtrlComponents::udp)
|
||||
.def_readonly("dt", &CtrlComponents::dt)
|
||||
;
|
||||
|
||||
|
|
|
@ -8,6 +8,10 @@ print("Press ctrl+\ to quit process.")
|
|||
|
||||
np.set_printoptions(precision=3, suppress=True)
|
||||
arm = unitree_arm_interface.ArmInterface(hasGripper=True)
|
||||
ctrlComp = arm._ctrlComp
|
||||
udp = unitree_arm_interface.UDPPort(IP = "127.0.0.1", toPort=8071, ownPort=8072)
|
||||
ctrlComp.udp = udp
|
||||
|
||||
armState = unitree_arm_interface.ArmFSMState
|
||||
arm.loopOn()
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@ import numpy as np
|
|||
|
||||
np.set_printoptions(precision=3, suppress=True)
|
||||
arm = unitree_arm_interface.ArmInterface(hasGripper=True)
|
||||
armModel = arm._ctrlComp.armModel
|
||||
ctrlComp = arm._ctrlComp
|
||||
udp = unitree_arm_interface.UDPPort(IP = "127.0.0.1", toPort=8071, ownPort=8072)
|
||||
ctrlComp.udp = udp
|
||||
|
||||
print('--------------------------FK & IK------------------------')
|
||||
q_FORWARD = np.array([0, 1.5, -1, 0.54, 0, 0])
|
||||
|
|
Loading…
Reference in New Issue