HiroIshida / snippets

fraction of codes which may be grepped later
6 stars 3 forks source link

pr2 joint goal unsatisfaction debug #49

Open HiroIshida opened 11 months ago

HiroIshida commented 11 months ago
from skrobot.models.pr2 import PR2
from skrobot.interfaces.ros import PR2ROSRobotInterface

pr2 = PR2()
ri = PR2ROSRobotInterface(pr2)
ri.angle_vector(pr2.angle_vector(), time_scale=1.0)
ri.wait_interpolation()
joint_names = pr2.joint_names
av_real = ri.angle_vector()
av_target = pr2.angle_vector()
for i, name in enumerate(joint_names):
    if "caster" in name:
        continue
    a = av_real[i]
    b = av_target[i]
    if abs(a - b) > 0.3:
        print(f"Warning: Large discrepancy in joint '{name}'. Real: {a}, Target: {b}")
[http://pr1040:11311][133.11.216.116] h-ishida@azarashi:~/misc/snippets/ros/tools$ python3 fuck.py 
/home/h-ishida/python/scikit-robot/skrobot/model/robot_model.py:1718: UserWarning: texture specified in URDF is not supported
  warnings.warn(
Warning: Large discrepancy in joint 'l_forearm_roll_joint'. Real: 25.132736206054688, Target: 0.0
Warning: Large discrepancy in joint 'l_wrist_roll_joint'. Real: -56.54869079589844, Target: 0.0

follow joint trajectory, お前なにしてんねんアホが

上がgoal, 下がfeedback. なぜか0になってる

image

HiroIshida commented 10 months ago

robot_mechanims_controllerないでは, こうやってerrorが計算されているが, jointはhardwareに直付されてる. image