Loading robots#
Loading your Robot#
To load a robot, you’ll need to use the RobotWrapper
class. This class is wrapping
the robot model, state and exposing all convenient methods to interact with your robot model.
Using URDF file#
To load your robot, you can simply specify an URDF file this way:
import placo
robot = placo.RobotWrapper("model/robot.urdf")
Note
If you only specify a directory, the robot.urdf
file will be loaded.
Flags#
The second argument of RobotWrapper
is a flag to specify modifiers. Available
flags are the following:
Flag |
Description |
---|---|
|
Load collision geometry as visual geometry. |
|
Ignore all collisions (remove all the pairs). |
For more information about the handling of self-collisions, see Self-collisions. An example would be:
import placo
# Loading a robot, ignoring all collisions
robot = placo.RobotWrapper("model/robot.urdf", placo.Flags.ignore_collisions)
Using direct URDF contents#
The third argument of RobotWrapper
can be provided if you want to
give the contents of the URDF file directly:
import placo
# Providing directly the URDF contents
robot = placo.RobotWrapper("model/", 0, urdf_contents)