Double Pendulum Graphical Models

The rcp.QtDoublePendulum module contains several classes which use PyQt5 to render GUI cartoon representations of a double-pendulum system.

rcp.QtDoublePendulum

class rcp.QtDoublePendulum.QtDoublePendulum[source]

Bases: PyQt5.QtWidgets.QWidget

Custom widget representing a double pendulum.

update_positions(positions)[source]

Update the joint angles for the double pendulum cartoon. Angles are in radians, with zero defined pointing straight down, and CCW positive rotations.

Parameters

positions – an array or ndarray with at least two elements [q0 q1]

class rcp.QtDoublePendulum.QtDoublePendulumItem(parent=None, l1=300, l2=300)[source]

Bases: PyQt5.QtWidgets.QGraphicsItem

Custom QGraphicsItem representing a double-pendulum in a QGraphicsScene.

update_positions(positions)[source]

Update the joint angles for the double pendulum cartoon. Angles are in radians, with zero defined pointing straight down, and CCW positive rotations.

Parameters

positions – an array or ndarray with at least two elements [q0 q1]