Metadata-Version: 2.1
Name: view-animator
Version: 0.1.0
Summary: Animate the camera view for a variety of environments
Author-email: Sheng Zhong <zhsh@umich.edu>
Maintainer-email: Sheng Zhong <zhsh@umich.edu>
License: Copyright (c) Sheng Zhong
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        
Project-URL: Homepage, https://github.com/LemonPi/view_animator
Project-URL: Bug Reports, https://github.com/LemonPi/view_animator/issues
Project-URL: Source, https://github.com/LemonPi/view_animator
Keywords: camera,animation,visualization,simulation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Games/Entertainment :: Simulation
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: pybullet
Requires-Dist: pybullet ; extra == 'pybullet'

## 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

```python
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)
```
![dO08ur.gif](https://imgpile.com/images/dO08ur.gif)

Manual updating of an RViz orbiter

```python
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.PybulletOrbitter` for orbitting around a position with fixed pitch at a constant rate

### RViz
Requires the `rviz_animated_view_controller` plugin that can be installed with
```shell 
sudo apt install ros-<ros-distro>-rviz-animated-view-controller
```
e.g.
```shell
sudo apt install ros-noetic-rviz-animated-view-controller
```

- `view_animator.rviz_animator.RVizOrbitter` for orbitting around a position with fixed pitch at a constant rate
