@ -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.
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.
@ -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.
@ -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.
@ -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.
@ -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.
@ -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.
@ -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.
@ -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
@ -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.
@ -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.
@ -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