Browse Source

Update bash commands

pull/16/head
hello-chintan 1 year ago
parent
commit
70f0c1f435
3 changed files with 34 additions and 36 deletions
  1. +6
    -8
      getting_started/troubleshooting_guide.md
  2. +19
    -19
      getting_started/untethered_operation.md
  3. +9
    -9
      getting_started/updating_software.md

+ 6
- 8
getting_started/troubleshooting_guide.md View File

@ -2,19 +2,17 @@
This guide covers common issues and ways to resolve them. Please check the [Hello Robot Forum](https://forum.hello-robot.com) for additional topics not covered here.
## XBox teleoperation is not working
## Xbox teleoperation is not working
The provided Easy SMX wireless controller can accidentally be placed in the wrong mode. The mode is indicated by the round illuminated ring (shown as Connect below). The top 2 LEDs only should be illuminated. If a different LED pattern is shown then the button mapping expected by [stretch_xbox_controller_teleop.py](https://github.com/hello-robot/stretch_body/blob/master/tools/bin/stretch_xbox_controller_teleop.py) will be incorrect.
To set the controller into the correct mode:
- Hold the center button down for 5s. It will switch modes. Release.
- Repeat until top half of ring (upper two lights) are illuminated.
- Repeat until the top half of the ring (upper two lights) is illuminated.
In addition, check that the provided USB dongle is plugged into the robot USB port in its trunk.
.
![](./images/xbox.png)
## Battery is not staying charged
@ -29,7 +27,7 @@ In addition, check that the provided USB dongle is plugged into the robot USB po
## RPC Transport Errors (Stretch doesn't respond to commands)
If more than one instance of Stretch Body's [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) class is instantiated at a time, Stretch Body will report communication errors and will not always execute motion commands as expected. This is because [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) manages communications with the robot hardware and it doesn't support multiple writes to the USB devices.
If more than one instance of Stretch Body's [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) class is instantiated at a time, Stretch Body will report communication errors and will not always execute motion commands as expected. This is because the [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) class manages communications with the robot hardware and it doesn't support multiple writes to the USB devices.
These errors can appear as
@ -48,13 +46,13 @@ IOError(None): None
...
```
To check if a instance of [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) is already instantiated, you may use the Unix [top](https://www.unixtutorial.org/commands/top) command to monitor active processes. You may use the Unix [pkill](https://linuxize.com/post/pkill-command-in-linux/) command to end the background instance of Robot.
To check if an instance of [Robot](https://github.com/hello-robot/stretch_body/blob/master/body/stretch_body/robot.py) is already instantiated, you may use the Unix [top](https://www.unixtutorial.org/commands/top) command to monitor active processes. You may use the Unix [pkill](https://linuxize.com/post/pkill-command-in-linux/) command to end the background instance of Robot.
```console
```{.bash .shell-prompt}
$ pkill -9 python
```
As shipped, Stretch launches [stretch_xbox_controller_teleop.py](https://github.com/hello-robot/stretch_body/blob/master/tools/bin/stretch_xbox_controller_teleop.py) upon boot. It is necessary to turn off this automatic launch feature, otherwise your own Robot instance will conflict with this script. Additionally, if you are logged into multiple accounts, a Robot instance may be active in another user account.
As shipped, Stretch launches [stretch_xbox_controller_teleop.py](https://github.com/hello-robot/stretch_body/blob/master/tools/bin/stretch_xbox_controller_teleop.py) upon boot. It is necessary to turn off this automatic launch feature, otherwise, your own Robot instance will conflict with this script. Additionally, if you are logged into multiple accounts, a Robot instance may be active in another user account.
To turn it off, search for 'Startup' from Ubuntu Activities. Uncheck the box for 'hello_robot_xbox_teleop'.

+ 19
- 19
getting_started/untethered_operation.md View File

@ -15,17 +15,17 @@ This is the recommended approach if you are running Windows or MacOS. This metho
While Stretch is tethered to the monitor, keyboard, and mouse setup, first verify that the robot is connected to the wireless network then install Vino VNC server using the following command:
```console
```{.bash .shell-prompt}
$ sudo apt install vino
```
Go to System Settings. Select the Sharing tab and turn it on then, turn on Screen Sharing and choose a password. If you plan to connect to the robot from a Windows or MacOS machine, then open a terminal and run the following command.
```console
```{.bash .shell-prompt}
$ sudo gsettings set org.gnome.Vino require-encryption false
```
Finally, we need the robot's IP address, username, and password. Open a terminal and run `ifconfig`, which will print out the network information of the machine. In the wireless section (typically named wlp2s0), look for something that looks like "inet 10.0.0.15". The four numbers represent the IP address of the robot on the local network. The robot's default username and password is printed on papers that came in the tools box alongside the robot.
Finally, we need the robot's IP address, username, and password. Open a terminal and run `ifconfig`, which will print out the network information of the machine. In the wireless section (typically named wlp2s0), look for something that looks like "inet 10.0.0.15". The four numbers represent the IP address of the robot on the local network. The robot's default username and password are printed on papers that came in the tools box alongside the robot.
VNC will only function properly with an external display attached to the robot. Using a dummy HDMI dongle when operating the robot untethered via VNC is recommended. One possible dummy HDMI dongle can be found on Amazon [here](https://www.amazon.com/gp/product/B07BBT9NCZ/). On your computer, connect to the same wireless network as the robot and open the VNC package being used. Using the robot's IP address and username, initialize a new connection to the robot. The robot's desktop will open in a new window.
@ -33,35 +33,35 @@ VNC will only function properly with an external display attached to the robot.
#### Requirements
This is the recommended approach if you are running an Unix-based operating system, like Ubuntu or Arch Linux. This method requires both SSH and X Server to be installed. While most Unix-based operating systems have both installed by default, MacOS will only have SSH installed and Windows has neither installed by default. It is possible to install these tools for MacOS or Windows.
This is the recommended approach if you are running a Unix-based operating system, like Ubuntu or Arch Linux. This method requires both SSH and X Server to be installed. While most Unix-based operating systems have both installed by default, MacOS will only have SSH installed and Windows has neither installed by default. It is possible to install these tools for MacOS or Windows.
#### How To
While the [Remote Desktop](#remote-desktop) approach is easy to set up, graphics and interaction with the remote desktop is often slow. In this method, we will use SSH and X Server to accomplish the same a bit faster. SSH stands for Secure Shell, enabling one to remotely use the terminal (shell) of another machine. X Server is used on many Unix variants to render the Windowed GUI of applications. With SSH and X Server, it is possible to render a Windowed GUI of an application running on the robot on your computer's screen.
While the [Remote Desktop](#remote-desktop) approach is easy to set up, graphics and interaction with the remote desktop are often slow. In this method, we will use SSH and X Server to accomplish the same a bit faster. SSH stands for Secure Shell, enabling one to remotely use the terminal (shell) of another machine. X Server is used on many Unix variants to render the Windowed GUI of applications. With SSH and X Server, it is possible to render a Windowed GUI of an application running on the robot on your computer's screen.
The first step is to identify the robot's IP address on the local network. While Stretch is tethered to the monitor, keyboard, and mouse, verify that the robot is connected to a wireless network. Then, open a terminal and run `ifconfig`, which will print out the network information of the machine. In the wireless section (typically named wlp2s0), look for something that looks like "inet 10.0.0.15". The four numbers represent the IP address of the robot on the local network. Using any other machine on the same local network, I can SSH into the robot using this IP address. Take note of the username and password of the robot. The default combo is printed on papers that came in the tools box alongside the robot.
To SSH into the robot, run the following. It will require the password and may ask you to add the robot to the known hosts.
```console
```{.bash .shell-prompt}
$ ssh -X username@ip-address
```
Now that you're SSH-ed into the robot, you can disconnect any wires from the robot. You can accomplish any of the same tasks through the terminal. For example, you can type in `ipython` and interact with the robot using Stretch Body, as explained in the [Quick Start Guide](./quick_start_guide_re2.md#start-coding).
Furthermore, Windowed GUI applications that would have displayed on the monitor will now display on your SSH-ed machine. For example, we can open Rviz to visualize what the robot is seeing. Open two terminals and SSH into the robot as explained above. In the first, run `roslaunch stretch_core stretch_driver.launch`. You should see some information print out in the terminal. In the second, run `rviz`. A window will pop up and information about the robot can be visualized by clicking on `Add -> RobotModel` and `Add -> By Topic -> /Scan`. Additional information on how to use ROS tools can be found in [ROS's tutorials](http://wiki.ros.org/ROS/Tutorials) or in our [Stretch ROS guides](README.md#ros-interface).
Furthermore, Windowed GUI applications that would have been displayed on the monitor will now display on your SSH-ed machine. For example, we can open Rviz to visualize what the robot is seeing. Open two terminals and SSH into the robot as explained above. In the first, run `roslaunch stretch_core stretch_driver.launch`. You should see some information print out in the terminal. In the second, run `rviz`. A window will pop up and information about the robot can be visualized by clicking on `Add -> RobotModel` and `Add -> By Topic -> /Scan`. Additional information on how to use ROS tools can be found in [ROS's tutorials](http://wiki.ros.org/ROS/Tutorials) or in our [Stretch ROS guides](README.md#ros-interface).
#### Moving files to/from the robot wirelessly
It's common to need to move files to/from the robot wirelessly and a tool similar to SSH can help with this: Secure Copy (SCP).
To send the files from your computer to the robot, run:
```console
```{.bash .shell-prompt}
$ scp ./filename username@ip-address:~/path/to/put/it/
```
To copy the files from the robot to your computer, run the reverse:
```console
```{.bash .shell-prompt}
$ scp username@ip-address:/path/to/filename ~/path/to/put/it/
```
@ -81,14 +81,14 @@ First, identify your robot's and computer's IP address on the network (e.g. usin
Next, run the following on the robot:
```console
```{.bash .shell-prompt}
$ export ROS_IP=robot-ip-address
$ export ROS_MASTER_URI=http://robot-ip-address:11311/
```
Next, start the ROS launch files on the robot as you normally would. Finally, on your computer, run:
```console
```{.bash .shell-prompt}
$ export ROS_IP=computer-ip-address
$ export ROS_MASTER_URI=http://robot-ip-address:11311
```
@ -99,13 +99,13 @@ Tools like [rostopic](http://wiki.ros.org/rostopic) and [rosservice](http://wiki
#### Visualizing remotely with RViz
If you'd like to visualize the robot model on your computer using Rviz, you'll need to setup a ROS workspace with the [Stretch Description](https://github.com/hello-robot/stretch_ros/tree/master/stretch_description) package. First, copy over the `~/stretch_user` directory from the robot to your computer (e.g. using [Secure Copy](#moving-files-tofrom-the-robot-wirelessly)). Second, clone [Stretch Install](https://github.com/hello-robot/stretch_install/), and checkout the [noetic branch](https://github.com/hello-robot/stretch_install/tree/dev/install_20.04) if you are running ROS Noetic on the robot. Finally, run the [stretch_create_ros_workspace.sh](https://github.com/hello-robot/stretch_install/blob/master/stretch_create_ros_workspace.sh) script. A ROS Workspace with the Stretch ROS packages is now set up on your computer. Furthermore, Stretch Description has been set up with your robot's calibrated URDF.
If you'd like to visualize the robot model on your computer using Rviz, you'll need to set up a ROS workspace with the [Stretch Description](https://github.com/hello-robot/stretch_ros/tree/master/stretch_description) package. First, copy over the `~/stretch_user` directory from the robot to your computer (e.g. using [Secure Copy](#moving-files-tofrom-the-robot-wirelessly)). Second, clone [Stretch Install](https://github.com/hello-robot/stretch_install/), and checkout the [noetic branch](https://github.com/hello-robot/stretch_install/tree/dev/install_20.04) if you are running ROS Noetic on the robot. Finally, run the [stretch_create_ros_workspace.sh](https://github.com/hello-robot/stretch_install/blob/master/stretch_create_ros_workspace.sh) script. A ROS Workspace with the Stretch ROS packages is now set up on your computer. Furthermore, Stretch Description has been set up with your robot's calibrated URDF.
We can now use remote master and Rviz to visualize what the robot is seeing on your computer. Open two terminals. In the first, [SSH](#ssh-x-server) into the robot and run `roslaunch stretch_core stretch_driver.launch`. You should see some information print out in the terminal. In the second, run `rviz`. A window will pop up and information about the robot can be visualized by clicking on `Add -> RobotModel` and `Add -> By Topic -> /Scan`. Additional information on how to use Rviz can be found in [ROS's tutorials](http://wiki.ros.org/ROS/Tutorials) or in our [Stretch ROS guides](README.md#ros-interface).
We can now use remote master and Rviz to visualize what the robot is seeing on your computer. Open two terminals. First, [SSH](#ssh-x-server) into the robot and run `roslaunch stretch_core stretch_driver.launch`. You should see some information print out in the terminal. In the second, run `rviz`. A window will pop up and information about the robot can be visualized by clicking on `Add -> RobotModel` and `Add -> By Topic -> /Scan`. Additional information on how to use Rviz can be found in [ROS's tutorials](http://wiki.ros.org/ROS/Tutorials) or our [Stretch ROS guides](README.md#ros-interface).
## Additional Ideas
Although the methods described above will enable you to wirelessly control the robot, there are a number of way to improve usability and security of your wireless connection. These ideas are listed here.
Although the methods described above will enable you to wirelessly control the robot, there are several ways to improve the usability and security of your wireless connection. These ideas are listed here.
### Hotspot
@ -119,25 +119,25 @@ It is possible to simultaneously develop code on the robot while running wireles
### Static IP Address
Routers that serve wireless networks often dynamically assign IP address to machines that connect to the network. This means that your robot's IP address may have changed since the last time you turned it on. Since it becomes a pain to connect to the monitor, keyboard, and mouse setup every time to run `ifconfig`, many users prefer to assign the robot a static IP address. If you control the router, visit the router's settings page to set up the robot's static IP address. It is common at universities and companies to have staff dedicated to the management of the network. This staff will often be able to set up a static IP address for the robot.
Routers that serve wireless networks often dynamically assign IP addressess to machines that connect to the network. This means that your robot's IP address may have changed since the last time you turned it on. Since it becomes a pain to connect to the monitor, keyboard, and mouse setup every time to run `ifconfig`, many users prefer to assign the robot a static IP address. If you control the router, visit the router's settings page to set up the robot's static IP address. It is common at universities and companies to have staff dedicated to the management of the network. This staff will often be able to set up a static IP address for the robot.
### Public Key Authentication
The method of SSH described in [SSH & X Server](#ssh-x-server) uses basic password authentication when connecting. There is a better and more-secure method of SSH-ing into the robot called Public Key Authentication. This method will allow multiple developers to SSH into the robot without having to share the robot's admin password.
The method of SSH described in [SSH & X Server](#ssh-x-server) uses basic password authentication when connecting. There is a better and more secure method of SSH-ing into the robot called Public Key Authentication. This method will allow multiple developers to SSH into the robot without having to share the robot's admin password.
The first step is to generate public and private keys on your computer. Linux and MacOS machines can simply open the terminal and run:
```console
```{.bash .shell-prompt}
$ ssh-keygen -t ed25519 -f <key_filepath_without_extension> -C "<some comment>"
```
It will prompt you to enter a password. If you do, you'll need it to use the private key when you SSH into the robot. Next, we give the robot the public key. Linux and MacOS machines can run:
```console
```{.bash .shell-prompt}
$ ssh-copy-id -i <key_filepath_without_extension> username@ip-address
```
This requires you to know the username and ip-address of the robot. Instructions on how to find this information is found in the [SSH & X Server](#ssh-x-server) section. You may now SSH into the robot as normal, and no prompt for the robot's password will appear.
This requires you to know the username and IP address of the robot. Instructions on how to find this information are found in the [SSH & X Server](#ssh-x-server) section. You may now SSH into the robot as normal, and no prompt for the robot's password will appear.
------
<div align="center"> All materials are Copyright 2022 by Hello Robot Inc. Hello Robot and Stretch are registered trademarks.</div>

+ 9
- 9
getting_started/updating_software.md View File

@ -17,7 +17,7 @@ Stretch ROS is the [Robot Operating System](https://www.ros.org/about-ros/) (ROS
**Warning**: Before you proceed, please ensure that all your personal files in the catkin or ament workspace have been backed up safely. This is important because executing the following set of commands deletes your existing workspace and replaces it with a fresh one.
To download the stretch_install repo, execute:
```console
```{.bash .shell-prompt}
cd ~/
git clone https://github.com/hello-robot/stretch_install.git
cd stretch_install
@ -25,19 +25,19 @@ git pull
```
To replace the ROS Melodic catkin_ws in Ubuntu 18.04, execute:
```console
```{.bash .shell-prompt}
# Create a ROS workspace
./factory/18.04/stretch_create_catkin_workspace.sh -w <optional-path-to-ws>
```
To replace the ROS Noetic catkin_ws in Ubuntu 20.04, execute:
```console
```{.bash .shell-prompt}
# Create a ROS workspace
./factory/20.04/stretch_create_catkin_workspace.sh -w <optional-path-to-ws>
```
To replace the ROS 2 Galactic ament_ws in Ubuntu 20.04, execute:
```console
```{.bash .shell-prompt}
# Create a ROS2 workspace
./factory/20.04/stretch_create_ament_workspace.sh -w <optional-path-to-ws>
```
@ -47,7 +47,7 @@ To replace the ROS 2 Galactic ament_ws in Ubuntu 20.04, execute:
Stretch Body is the Python SDK to the robot. It abstracts away the low level details of communication with the embedded devices and provides an intuitive API to working with the robot. You may update it using the following commands depending on the Python version.
If you are using Python2, execute:
```console
```{.bash .shell-prompt}
$ pip install -U hello-robot-stretch-body
$ pip install -U hello-robot-stretch-body-tools
$ pip install -U hello-robot-stretch-factory
@ -55,7 +55,7 @@ $ pip3 install -U hello_robot_stretch_body_tools_py3
```
For Python3, execute:
```console
```{.bash .shell-prompt}
python3 -m pip -q install --no-warn-script-location hello-robot-stretch-body
python3 -m pip -q install --no-warn-script-location hello-robot-stretch-body-tools
python3 -m pip -q install --no-warn-script-location hello-robot-stretch-factory
@ -66,7 +66,7 @@ python3 -m pip -q install --no-warn-script-location hello-robot-stretch-tool-sha
The firmware and the Python SDK (called Stretch Body) communicate on an established protocol. Therefore, it is important to maintain a protocol match between the different firmware and Stretch Body versions. Fortunately, there is a script that handles this automatically. In the command line, run the following command:
```console
```{.bash .shell-prompt}
$ REx_firmware_updater.py --status
```
@ -76,7 +76,7 @@ This script will automatically determine what version is currently running on th
The operating system upon which Stretch is built is called Ubuntu. This operating system provides the underlying packages that power Stretch's software packages. Furthermore, users of Stretch depend on this operating system and the underlying packages to develop software on Stretch. Therefore, it is important to keep the OS and these underlying packages up to date. In the command line, run the following command:
```console
```{.bash .shell-prompt}
$ sudo apt update
$ sudo apt upgrade
```
@ -101,7 +101,7 @@ Please upgrade the firmware and/or version of Stretch Body.
This error appears because the low level Python SDK and the firmware cannot communicate to each other. There is a protocol mismatch preventing communication between the two. Simply run the following script and follow its recommendations to upgrade/downgrade the firmware as necessary to match the protocol level of Stretch Body.
```console
```{.bash .shell-prompt}
$ REx_firmware_updater.py --status
```

Loading…
Cancel
Save