8000 Updated README to reflect new changes. ( clear_scene(), wrap_to_pi() ) · NickNgHK/robotics-toolbox-python@391e1bf · GitHub
[go: up one dir, main page]

Skip to content

Commit 391e1bf

Browse files
committed
Updated README to reflect new changes. ( clear_scene(), wrap_to_pi() )
1 parent bd2771d commit 391e1bf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

graphics/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Instructions on how to use the graphical section of the toolbox below.
1111
* Grid Updating
1212
* On rotation/move finish
1313
* ~~Don't redraw labels, move/update them~~
14-
* Don't redraw the grid, move/update them
14+
* ~~Don't redraw the grid, move/update them~~
1515
* Error handling
1616
* ~~Throw custom error messages~~
1717
* Handle vpython error messages
@@ -39,6 +39,8 @@ The `vector` class is also very crucial to the graphics. It can either represent
3939
For convenience, some functions and variables are provided for easy use. `wrap_to_pi()` takes in an angle, and specification on degrees or radians. It returns the respective angle between -pi and pi.
4040
Three vectors are also supplied for readability to ensure correct axes are used when referencing. `x_axis_vector`, `y_axis_vector`, `z_axis_vector` can be used when supplying the rotation axis, for example.
4141
```python
42+
# Wrap an angle (deg) to the range [-pi pi]. use "rad" instead of "deg" for radian angles.
43+
wrap_to_pi("deg", 450)
4244
# Rotate the joint around its local x-axis by 30 degrees
4345
rot_link.rotate_around_joint_axis(radians(30), x_axis_vector)
4446
```
@@ -70,6 +72,15 @@ canvas_grid.set_visibility(False)
7072
```
7173
Now that the scene is created, a robot must be created to be displayed.
7274

75+
At anytime you can clear the scene of all objects (The grid will remain if visible). Note: This will note delete the objects,
76+
they still exist, and can be rendered visible afterwards. However, overwriting/deleting the variables will free the memory.
77+
If an object is overwritten/deleted while still visible, the objects will remain in the scene.
78+
```python
79+
canvas_grid.clear_scene()
80+
```
81+
82+
83+
7384
## Displaying Robot Joints
7485
If you want to use the example puma560 robot, simply call the creation function that will return a GraphicalRobot object. It will automatically be displayed in the canvas
7586
```python

0 commit comments

Comments
 (0)
0