Model package#

The model package builds the graph of the robot model and stores the information about the robot’s kinematics and dynamics.

class adam.model.model.Model(name: str, links: dict[str, Link], frames: dict[str, Link], joints: dict[str, Joint], tree: Tree, NDoF: int, actuated_joints: list[str])[source]#

Bases: object

Model class. It describes the robot using links and frames and their connectivity

name: str[source]#
frames: dict[str, Link][source]#
joints: dict[str, Joint][source]#
tree: Tree[source]#
NDoF: int[source]#
actuated_joints: list[str][source]#
property N: int[source]#

Returns: int: the number of links in the model

static build(factory: ModelFactory, joints_name_list: list[str] = None) Model[source]#

generates the model starting from the list of joints and the links-joints factory

Parameters:
  • factory (ModelFactory) – the factory that generates the links and the joints, starting from a description (eg. urdf)

  • joints_name_list (list[str]) – the list of the actuated joints

Returns:

the model describing the robot

Return type:

Model

get_joints_chain(root: str, target: str) list[Joint][source]#

generate the joints chains from a link to a link

Parameters:
  • root (str) – the starting link

  • target (str) – the target link

Returns:

the list of the joints

Return type:

list[Joint]

get_total_mass() float[source]#

total mass of the robot

Returns:

the total mass of the robot

Return type:

float

print_table()[source]#

print the table that describes the connectivity between the elements. You need rich to use it

adam.model.tree module#

class adam.model.tree.Node(name: str, link: Link, arcs: list[Joint], children: list[Node], parent: Link | None = None, parent_arc: Joint | None = None)[source]#

Bases: object

The node class

name: str[source]#
arcs: list[Joint][source]#
children: list[Node][source]#
parent: Link | None = None[source]#
parent_arc: Joint | None = None[source]#
get_elements() tuple[Link, Joint, Link][source]#

returns the node with its parent arc and parent link

Returns:

the node, the parent_arc, the parent_link

Return type:

tuple[Link, Joint, Link]

class adam.model.tree.Tree(graph: dict[str, Node], root: str)[source]#

Bases: Iterable

The directed tree class

graph: dict[str, Node][source]#
root: str[source]#
static build_tree(links: list[Link], joints: list[Joint]) Tree[source]#

builds the tree from the connectivity of the elements

Parameters:
Returns:

the directed tree

Return type:

Tree

print(root)[source]#

prints the tree

Parameters:

root (str) – the root of the tree

get_ordered_nodes_list(start: str) list[str][source]#

get the ordered list of the nodes, given the connectivity

Parameters:

start (str) – the start node

Returns:

the ordered list

Return type:

list[str]

classmethod get_children(node: Node, list: list)[source]#

Recursive method that finds children of child of child :param node: the analized node :type node: Node :param list: the list of the children that needs to be filled :type list: list

get_idx_from_name(name: str) int[source]#
Parameters:

name (str) – node name

Returns:

the index of the node in the ordered list

Return type:

int

get_name_from_idx(idx: int) str[source]#
Parameters:

idx (int) – the index in the ordered list

Returns:

the corresponding node name

Return type:

str

get_node_from_name(name: str) Node[source]#
Parameters:

name (str) – the node name

Returns:

the node istance

Return type:

Node

Module contents#