Verify with Example Programs
The Composer Studio repository ships standalone Python scripts in
examples/. They call the PDK server directly, without Composer Studio, and
show the PDK calls behind each Composer Studio feature. They are also a quick
way to check that the server and your licenses work.
Run them from the repository root, with the virtual environment from Install Composer Studio active and a server running:
python3 examples/example_workcell_service.py
Load the workcell they create in Composer Studio (Workcells) to see the result.
Important
The examples work in a workcell called example_workcell, and most of them
delete it first. Do not run them against a workcell of that name that
you want to keep.
The examples connect to localhost:50052. To use another server, edit
target near the top of main().
Script |
Shows |
Needs |
|---|---|---|
|
List, delete and create workcells. Workcells |
server |
|
A scene with a robot system and objects. Scene Objects |
server |
|
Load |
an existing |
|
A robot system, and the component catalogue. Systems |
server |
|
Add a system from a connected robot, like Sync from Controller. Systems |
real robot; edit |
|
Forward and inverse kinematics. Targets |
server |
|
Save poses as targets and plan between them. PTP Trajectories |
|
|
PTP planning with several collision configurations. Collision Configurations |
|
|
A sketch tool path on a mesh. Tool Paths |
|
|
A raster tool path on a mesh. Tool Paths |
|
|
A path, robot motion with velocity, acceleration and force, and an RCA trajectory file. Linear Path Trajectories |
|
|
The mesh filter. Scene Objects |
|
|
Area extraction from a mesh. Areas |
|
|
A camera on a robot; save its images and point cloud. Cameras |
real robot and camera; edit the serial number and camera ID |
|
Reconstruct the scene from camera data. |
real robot and camera; edit the serial number and camera ID |
Mesh file
The examples marked mesh file load a 1 m × 1 m plane from
/home/flexiv/user_data/meshes/plane_1m_10x10.obj. The path is read on
the server: for a server running in a container, it is the path inside the
container, which is user_data/meshes/ in the server’s release folder on the
host.
The mesh is not in the Composer Studio repository. Copy it from
examples/assets/plane_1m_10x10.obj in the
Flexiv PDK repository.