[Python] AttributeError: 'Axes3D' object has no attribute 'w_xaxis'

Discussão em 'Python' iniciado por Stack, Maio 24, 2025.

  1. Stack

    Stack Membro Participativo

    I am new to this toolbox,it's robotics-toolbox-python, when running the following code,

    import roboticstoolbox as rtb
    robot = rtb.models.Panda()
    print("robot = " ,robot)
    Te = robot.fkine(robot.qr) # forward kinematics
    print("Te = " , Te)
    from spatialmath import SE3

    Tep = SE3.Trans(0.6, -0.3, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1])
    sol = robot.ik_LM(Tep) # solve IK
    print("sol=", sol)


    q_pickup = sol[0]
    print(robot.fkine(q_pickup)) # FK shows that desired end-effector pose was achieved

    qt = rtb.jtraj(robot.qr, q_pickup, 50)
    robot.plot(qt.q, backend='pyplot', movie='panda1.gif')


    the final 2 lines raise error "Traceback (most recent call last): File "f:\Codefield\CODE_P\youtube_follow\test.py", line 17, in robot.plot(qt.q, backend='pyplot', movie='panda1.gif') File "G:\Conda_envlist\RV\lib\site-packages\roboticstoolbox\robot\BaseRobot.py", line 2372, in plot images.append(env.getframe()) File "G:\Conda_envlist\RV\lib\site-packages\roboticstoolbox\backends\PyPlot\PyPlot.py", line 419, in getframe self.ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 1.0)) AttributeError: 'Axes3D' object has no attribute 'w_xaxis'. Did you mean: 'xaxis'?"

    how to solve the error

    Continue reading...

Compartilhe esta Página