Skip to main content

Library for creating OCTAS® world XML files through Python.

Project description

octapyx

A Python framework for writing OCTAS® XML files via Python code.

It imports OCTAS® definitions for steppers and properties, and provides these through Python modules.

Python code written based on octapyx XML file to be opened in OCTAS®
import octapyx.oct.world as world
from octapyx.modules.org.octane.oct.ent import Camera
from octapyx.modules.org.octane.oct.prop import Pose, TfTree
from octapyx.modules.org.octane.stdlib import TfTreeStepper

world = world.World()

renderCamera = world.add(
	Camera("renderCamera"))

renderCamera.assign(
	Pose(
		position=[1, 2, 3]))

renderCamera.assign(
	TfTree(
		position=[3, 2, 1]))

tfTreeStepper = world.add(
	TfTreeStepper(
		name="tfTreeStepper"))

tfTreeStepper.registerEntity(
	entity=renderCamera)

tfTreeStepper.step()

world.addToScheduler(tfTreeStepper)

world.write("example.oct.xml")

# Optional: Run OCTAS® directly
# by loading the world.
world.run()
<World>
	<!--Generated by octapyx.-->
	<Entity
		ucn="octane.org/oct/ent/Camera"
		name="renderCamera">
		<Property
			ucn="octane.org/oct/prop/Pose"
			position="1 2 3"
			/>
		<Property
			ucn="octane.org/oct/prop/TfTree"
			position="3 2 1"
			/>
	</Entity>
	<Stepper
		ucn="octane.org/stdlib/TfTreeStepper"
		name="tfTreeStepper">
		<registerEntity
			name="renderCamera"
			/>
	</Stepper>
	<Build
		fromStepper="tfTreeStepper" />
	<Scheduler
		ucn="oct/sched/ASyncThreadScheduler">
		<addStepper
			name="tfTreeStepper" />
	</Scheduler>
</World>

In particular, it enables the use of Python control flows (if, for, ...), libraries and interfaces to generate complex scenes in a flexible, adaptive way.

Installation

Install the octapyx package by running:

pip install octapyx

or

pip install git+https://gitlab.cc-asp.fraunhofer.de/octas/tools/python/octaspyxml

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

octapyx-0.0.16.tar.gz (12.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

octapyx-0.0.16-py3-none-any.whl (210.2 kB view details)

Uploaded Python 3

File details

Details for the file octapyx-0.0.16.tar.gz.

File metadata

  • Download URL: octapyx-0.0.16.tar.gz
  • Upload date:
  • Size: 12.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for octapyx-0.0.16.tar.gz
Algorithm Hash digest
SHA256 ee5f2d859d0defae7fb5856862544428f8ce5c939d4bc1783e77fa410b78fd80
MD5 e32a376f2993cded6354cfc01fefc65d
BLAKE2b-256 73011611e6e35bba1c343fbd1a6a2b93598b03a4d37449c56788488c20a8a306

See more details on using hashes here.

File details

Details for the file octapyx-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: octapyx-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 210.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for octapyx-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 c73a0d372b9f70327860fa2540251001468b3f9854edd5e837d9b6a10537985f
MD5 9e53ea93f46b30359f92e81a78051f6b
BLAKE2b-256 545d1bfed9a894431ca07ec9c8367da9e3e4888a9066ba57b6867c9195a44700

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page