Animate the camera view for a variety of environments
Project description
View Animator
This package allows you to programmatically change the camera view for a variety of environments (for example pybullet simulation, and RViz visualization).
Installation
TODO after packaging for PYPI
Usage
The core of it is an animator object and its update() method. You can either update() the animator
manually, or automatically in a separate daemon thread.
Example automatic orbiting animation
from view_animator import animate_view_in_background
from view_animator.pybullet_animator import PybulletOrbitter
import pybullet as p
p.connect(p.GUI)
# other simulator configurations
# animate an orbit in the background at a distance of 0.5 away from the origin
orbiter = PybulletOrbitter(update_period=0.01, dist=0.5, target=(0, 0, 0))
animate_view_in_background(orbiter)
# set up objects
p.setRealTimeSimulation(1)
while True:
# do sim computations
time.sleep(0.001)
Manual updating of an RViz orbiter
from view_animator.rviz_animator import RVizOrbiter
import rospy
orbiter = RVizOrbiter(period=5, world_frame="world")
rate = rospy.Rate(1 / orbiter.update_period)
while not rospy.is_shutdown():
# visualization and other processing
orbiter.update()
rate.sleep()
Animators
While you can subclass view_animator.base_animator.ViewAnimator directly to suit your specific environment
and desired animation, there are a few predefined animators listed below. Note that you do not have to
have the environment installed to install this package.
Pybullet
Install pybullet with
pip install pybullet
view_animator.pybullet_animator.PybulletOrbitterfor orbitting around a position with fixed pitch at a constant rate
RViz
Requires the rviz_animated_view_controller plugin that can be installed with
sudo apt install ros-<ros-distro>-rviz-animated-view-controller
e.g.
sudo apt install ros-noetic-rviz-animated-view-controller
view_animator.rviz_animator.RVizOrbitterfor orbitting around a position with fixed pitch at a constant rate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file view_animator-0.1.0.tar.gz.
File metadata
- Download URL: view_animator-0.1.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41a55a6b439df394666cd576df14df948fa440155b5378e88bdc4ee5501c3c9c
|
|
| MD5 |
cecbe74bb21bdc4c8dcb554f65871ebe
|
|
| BLAKE2b-256 |
7d2426bec7e8436fc1da08af92563e249ed0e66f4dbc25c02dd04c89fff4d5be
|
File details
Details for the file view_animator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: view_animator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d03540770975f3761d229d4ed7e6172d80a82753adf08e4f5ab5880a2dec62ad
|
|
| MD5 |
1be102c70013d6410c837866261fea21
|
|
| BLAKE2b-256 |
9e0c3bf86e5845d9694f4384accd8e3b4b111972db814aef9d1512322cb8cd47
|