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.17.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.17-py3-none-any.whl (210.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: octapyx-0.0.17.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.17.tar.gz
Algorithm Hash digest
SHA256 2a53e6cdb30b1ff52cdbbdc09b476cff24edb5f2a3c484cee5ce126061747fb5
MD5 d31fdb80d384acf125ad6ee29c52feb3
BLAKE2b-256 68e7d43e8956a12d5431e97d124a296ef4809d44eb0c9fbb740c739c7a29fa9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: octapyx-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 210.3 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.17-py3-none-any.whl
Algorithm Hash digest
SHA256 2678c101f38b29bb251a745fa095d3565e5e70c4f5bd0d54cf56c413b9087ac8
MD5 e4981cb9ca8ab9fa415ea66677d1b6fe
BLAKE2b-256 24f9e4015ba98b065879305b10f4643e83901f72fbe64e6b641a241074557f5b

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