RobotModelArtist

class compas.artists.RobotModelArtist(*args, **kwargs)[source]

Bases: compas.artists.robotmodelartist.AbstractRobotModelArtist, compas.artists.artist.Artist

Provides common functionality to most robot model artist implementations.

In COMPAS, the artists are classes that assist with the visualization of datastructures and models, in a way that maintains the data separated from the specific CAD interfaces, while providing a way to leverage native performance of the CAD environment.

There are two methods that implementers of this base class should provide, one is concerned with the actual creation of geometry in the native format of the CAD environment (create_geometry()) and the other is one to apply a transformation to geometry (transform()).

Attributes

model (compas.robots.RobotModel) – Instance of a robot model.

Methods

attach_mesh(mesh, name[, link, frame])

Rigidly attaches a compas mesh to a given link for visualization.

attach_tool_model(tool_model)

Attach a tool to the robot artist for visualization.

build(item, **kwargs)

Build an artist corresponding to the item type.

build_as(item, artist_type, **kwargs)

clear()

create([link, context])

Recursive function that triggers the drawing of the robot model's geometry.

create_geometry(geometry[, name, color])

Draw a COMPAS geometry in the respective CAD environment.

detach_mesh(name)

Removes attached collision meshes with a given name.

detach_tool_model()

Detach the tool.

draw()

draw_attached_meshes()

Draws all meshes attached to the robot model.

draw_collection(collection)

draw_collision()

Draws all collision geometry of the robot model.

draw_visual()

Draws all visual geometry of the robot model.

get_artist_cls(data, **kwargs)

meshes([link, visual, collision, ...])

Returns all compas meshes of the model.

redraw()

register(item_type, artist_type)

scale(factor)

Scales the robot model's geometry by factor (absolute).

scale_link(link, transformation)

Recursive function to apply the scale transformation on each link.

transform(geometry, transformation)

Transforms a CAD-specific geometry using a COMPAS transformation.

update(joint_state[, visual, collision])

Triggers the update of the robot geometry.

update_tool([joint_state, visual, ...])

Triggers the update of the robot geometry of the tool.