RoPod/Tutorials/ConnectingToRobotWireless: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
= Entering Pico from terminal via the network =  
= Entering Pico from terminal via the network =  
Go to your .bashrc-file (cd to ~) and add the following lines at the bottom:
Did you follow the [[RoPod/Tutorials/Simulation | Simulation tutorials]]? Then all you did for the simulations should work on the robot as well! We only need to be able to communicate to the robot. Connect to the ropod-network (ask for the password). Running sshpico gives you access to pico in the ropod-user account(again, ask for the password) via the ssh-protocol. If the network is connected to internet as well, you checkout the git-repository on the robot itself of checkout the branch you are working on.


<pre>
Once you are running some packages on the robot and you want to use the information published and topics (for visualization using rviz for example), then open a terminal and run pico-core on your own pc. Now, from this terminal (where you run the pico-core command) you can use these data on your own pc, for example to visualize them in rviz. This might be relevant as well to set the initial-pose for localization for example.
source /home/ropod/ropod-project/catkin_workspace/src/platform/setup.bash
source /home/ropod/ropod-project/catkin_workspace/src/platform/devpc/setup.bash
</pre>


These files refer to some .bash-files in which some commands are given and in which some commands are set. Is your catkin_workspace located at another path? Then you should change it here! An overview of all the commands can be found at the [[ RoPod/Tutorials/Commands cheat sheet | cheat sheet]]
Here, some user-defined commands are given which actually execute some more complex ones. As the .bashrc is run each time you open a new terminal, you need to open a new terminal after adding these lines from your terminal.
Now, connect to the ropod-network (ask for the password). Running sshpico gives you access to pico in the ropod-user (again, ask for the password).
Once you are running some packages on the robot and you want to use the information published and topics (for example for visualization using rviz for example), then open a terminal and run pico-core on your own pc. Now, from this terminal (where you run the pico-core command) you can use these data on your own pc, for example to visualize them in rviz.


= Automatic key generation =
= Automatic key generation =

Latest revision as of 15:07, 26 October 2017

Entering Pico from terminal via the network

Did you follow the Simulation tutorials? Then all you did for the simulations should work on the robot as well! We only need to be able to communicate to the robot. Connect to the ropod-network (ask for the password). Running sshpico gives you access to pico in the ropod-user account(again, ask for the password) via the ssh-protocol. If the network is connected to internet as well, you checkout the git-repository on the robot itself of checkout the branch you are working on.

Once you are running some packages on the robot and you want to use the information published and topics (for visualization using rviz for example), then open a terminal and run pico-core on your own pc. Now, from this terminal (where you run the pico-core command) you can use these data on your own pc, for example to visualize them in rviz. This might be relevant as well to set the initial-pose for localization for example.


Automatic key generation

If you want to prevent using a password each time you want to log in to Pico, you need to generate a key. Therefore, you can use an automatic key generator, for example using the method copied from | this site running the next set of command from your local desktop system:

ssh-keygen

Make sure to use the default for the keyname. We suggest that you do set a passphrase on that key, otherwise it's a security problem. "-t rsa" wouldn't be a bad idea, but probably isn't needed.

ssh-copy-id ropod@192.168.44.81

That will ask you for the password you'd use to log in, and sets up the authorized_keys stuff for you. (no need to do it by hand) Then, this:

ssh-agent

or maybe this:

exec ssh-agent sh

or:

exec ssh-agent bash

That will start up an SSH agent that can hold your key. On many modern Unix variants, if you're logged in graphically, this will already have taken place. The first variant (with the backticks) puts an ssh-agent into the background and sets up the environment variables to talk to it. The second two have the agent run a shell for you, so that when you exit the shell, the agent exits. Many modern Unix variants will already have an agent running for you, especially if you logged in graphically. You might try "ps aux | grep ssh-agent" or "ps -ef | grep ssh-agent"; if something is already running, use that. Then, finally:

ssh-add

It will ask for a passphrase; give it the one you gave ssh-keygen. There's also ways to make it ask graphically. And you can put the ssh-agent and ssh-add stuff into your login scripts (setup is different depending on shell you use) to automate this, but some Unix variants (current Ubuntu Linux, for instance) do most of that automatically, so that all you really need to do is create a key and use ssh-copy-id to set it up on the remote host:

ssh-copy-id -i ~/.ssh/id_rsa.pub remote-user@remote-host

which in our case should be

ssh-copy-id -i ~/.ssh/id_rsa.pub ropod@192.168.44.81

Now, "ssh ropod@192.168.44.81" (or sshpico in our case!) should work without asking for any authentication. Behind the scenes, it's using a key that the ssh-agent is holding, and asking the agent to do the magic signing tricks for it.