Name | view-animator JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | Animate the camera view for a variety of environments |
upload_time | 2023-02-10 02:03:01 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.6 |
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. |
keywords |
camera
animation
visualization
simulation
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
## 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
Raw data
{
"_id": null,
"home_page": "",
"name": "view-animator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "Sheng Zhong <zhsh@umich.edu>",
"keywords": "camera,animation,visualization,simulation",
"author": "",
"author_email": "Sheng Zhong <zhsh@umich.edu>",
"download_url": "https://files.pythonhosted.org/packages/7d/24/26bec7e8436fc1da08af92563e249ed0e66f4dbc25c02dd04c89fff4d5be/view_animator-0.1.0.tar.gz",
"platform": null,
"description": "## View Animator\nThis package allows you to programmatically change the camera view for a variety of environments \n(for example pybullet simulation, and RViz visualization).\n\n## Installation\nTODO after packaging for PYPI\n\n## Usage\nThe core of it is an animator object and its `update()` method. You can either `update()` the animator\nmanually, or automatically in a separate daemon thread.\n\nExample automatic orbiting animation\n\n```python\nfrom view_animator import animate_view_in_background\nfrom view_animator.pybullet_animator import PybulletOrbitter\nimport pybullet as p\n\np.connect(p.GUI)\n# other simulator configurations\n\n# animate an orbit in the background at a distance of 0.5 away from the origin\norbiter = PybulletOrbitter(update_period=0.01, dist=0.5, target=(0, 0, 0))\nanimate_view_in_background(orbiter)\n# set up objects\n\np.setRealTimeSimulation(1)\nwhile True:\n # do sim computations\n time.sleep(0.001)\n```\n![dO08ur.gif](https://imgpile.com/images/dO08ur.gif)\n\nManual updating of an RViz orbiter\n\n```python\nfrom view_animator.rviz_animator import RVizOrbiter\nimport rospy\n\norbiter = RVizOrbiter(period=5, world_frame=\"world\")\nrate = rospy.Rate(1 / orbiter.update_period)\nwhile not rospy.is_shutdown():\n # visualization and other processing\n orbiter.update()\n rate.sleep()\n```\n## Animators\nWhile you can subclass `view_animator.base_animator.ViewAnimator` directly to suit your specific environment\nand desired animation, there are a few predefined animators listed below. Note that you do not have to\nhave the environment installed to install this package.\n\n### Pybullet\nInstall pybullet with\n```pip install pybullet```\n- `view_animator.pybullet_animator.PybulletOrbitter` for orbitting around a position with fixed pitch at a constant rate\n\n### RViz\nRequires the `rviz_animated_view_controller` plugin that can be installed with\n```shell \nsudo apt install ros-<ros-distro>-rviz-animated-view-controller\n```\ne.g.\n```shell\nsudo apt install ros-noetic-rviz-animated-view-controller\n```\n\n- `view_animator.rviz_animator.RVizOrbitter` for orbitting around a position with fixed pitch at a constant rate\n",
"bugtrack_url": null,
"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. ",
"summary": "Animate the camera view for a variety of environments",
"version": "0.1.0",
"split_keywords": [
"camera",
"animation",
"visualization",
"simulation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e0c3bf86e5845d9694f4384accd8e3b4b111972db814aef9d1512322cb8cd47",
"md5": "1be102c70013d6410c837866261fea21",
"sha256": "d03540770975f3761d229d4ed7e6172d80a82753adf08e4f5ab5880a2dec62ad"
},
"downloads": -1,
"filename": "view_animator-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1be102c70013d6410c837866261fea21",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6611,
"upload_time": "2023-02-10T02:02:59",
"upload_time_iso_8601": "2023-02-10T02:02:59.877326Z",
"url": "https://files.pythonhosted.org/packages/9e/0c/3bf86e5845d9694f4384accd8e3b4b111972db814aef9d1512322cb8cd47/view_animator-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7d2426bec7e8436fc1da08af92563e249ed0e66f4dbc25c02dd04c89fff4d5be",
"md5": "cecbe74bb21bdc4c8dcb554f65871ebe",
"sha256": "41a55a6b439df394666cd576df14df948fa440155b5378e88bdc4ee5501c3c9c"
},
"downloads": -1,
"filename": "view_animator-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "cecbe74bb21bdc4c8dcb554f65871ebe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7077,
"upload_time": "2023-02-10T02:03:01",
"upload_time_iso_8601": "2023-02-10T02:03:01.092217Z",
"url": "https://files.pythonhosted.org/packages/7d/24/26bec7e8436fc1da08af92563e249ed0e66f4dbc25c02dd04c89fff4d5be/view_animator-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-10 02:03:01",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "view-animator"
}