Browse Source

Changed python version in example code and code breakdown.

noetic
Alan G. Sanchez 2 years ago
parent
commit
27ac268746
12 changed files with 42 additions and 42 deletions
  1. +3
    -3
      example_1.md
  2. +6
    -6
      example_10.md
  3. +3
    -3
      example_11.md
  4. +3
    -3
      example_2.md
  5. +3
    -3
      example_3.md
  6. +3
    -3
      example_4.md
  7. +3
    -3
      example_5.md
  8. +3
    -3
      example_6.md
  9. +4
    -4
      example_7.md
  10. +3
    -3
      example_8.md
  11. +3
    -3
      example_9.md
  12. +5
    -5
      follow_joint_trajectory.md

+ 3
- 3
example_1.md View File

@ -26,7 +26,7 @@ To stop the node from sending twist messages, type **Ctrl** + **c**.
Below is the code which will send *Twist* messages to drive the robot forward.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist
@ -72,9 +72,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 6
- 6
example_10.md View File

@ -49,7 +49,7 @@ python3 stow_command.py
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import tf.transformations
@ -124,9 +124,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python
import rospy
@ -248,7 +248,7 @@ rotation:
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
from geometry_msgs.msg import TransformStamped
@ -296,9 +296,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python
import rospy

+ 3
- 3
example_11.md View File

@ -43,7 +43,7 @@ The gif below visualizes what happens when running the previous node.
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import tf
import sensor_msgs.point_cloud2 as pc2
@ -124,9 +124,9 @@ if __name__=="__main__":
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python
import rospy

+ 3
- 3
example_2.md View File

@ -72,7 +72,7 @@ Change the topic name from the LaserScan display from */scan* to */filter_scan*.
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
from numpy import linspace, inf
@ -116,9 +116,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 3
- 3
example_3.md View File

@ -31,7 +31,7 @@ To stop the node from sending twist messages, type **Ctrl** + **c** in the termi
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
from numpy import linspace, inf, tanh
@ -91,9 +91,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 3
- 3
example_4.md View File

@ -26,7 +26,7 @@ The gif below demonstrates how to add a new *Marker* display type, and change th
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
from visualization_msgs.msg import Marker
@ -84,9 +84,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 3
- 3
example_5.md View File

@ -32,7 +32,7 @@ It's important to note that the arm has 4 prismatic joints and the sum of these
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import sys
@ -87,9 +87,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 3
- 3
example_6.md View File

@ -27,7 +27,7 @@ This will send a `FollowJointTrajectory` command to move Stretch's arm or head w
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import time
import actionlib
@ -152,9 +152,9 @@ if __name__ == '__main__':
This code is similar to that of the [multipoint_command](https://github.com/hello-robot/stretch_tutorials/blob/main/src/multipoint_command.py) and [joint_state_printer](https://github.com/hello-robot/stretch_tutorials/blob/main/src/joint_state_printer.py) node. Therefore, this example will highlight sections that are different from those tutorials. Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 4
- 4
example_7.md View File

@ -71,7 +71,7 @@ An image named **camera_image.jpeg** is saved in the **stored_data** folder in t
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import sys
@ -125,9 +125,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python
@ -225,7 +225,7 @@ The node will publish a new Image topic named */image_edge_detection*. This can
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import sys

+ 3
- 3
example_8.md View File

@ -27,7 +27,7 @@ The ReSpeaker will be listening and will start to interpret speech and save the
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import os
@ -71,9 +71,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 3
- 3
example_9.md View File

@ -53,7 +53,7 @@ To stop the node from sending twist messages, type **Ctrl** + **c** or say "**qu
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import math
import rospy
@ -266,9 +266,9 @@ if __name__ == '__main__':
This code is similar to that of the [multipoint_command](https://github.com/hello-robot/stretch_tutorials/blob/main/src/multipoint_command.py) and [joint_state_printer](https://github.com/hello-robot/stretch_tutorials/blob/main/src/joint_state_printer.py) node. Therefore, this example will highlight sections that are different from those tutorials. Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python

+ 5
- 5
follow_joint_trajectory.md View File

@ -30,7 +30,7 @@ This will send a `FollowJointTrajectory` command to stow Stretch's arm.
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
from control_msgs.msg import FollowJointTrajectoryGoal
@ -88,9 +88,9 @@ if __name__ == '__main__':
Now let's break the code down.
```python
#!/usr/bin/env python
#!/usr/bin/env python3
```
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python script.
Every Python ROS [Node](http://wiki.ros.org/Nodes) will have this declaration at the top. The first line makes sure your script is executed as a Python3 script.
```python
@ -181,7 +181,7 @@ This will send a list of `JointTrajectoryPoint` message types to move Stretch's
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import time
@ -335,7 +335,7 @@ The joint, *joint_gripper_finger_left*, is only needed when actuating the grippe
### The Code
```python
#!/usr/bin/env python
#!/usr/bin/env python3
import rospy
import time

Loading…
Cancel
Save