0% found this document useful (0 votes)
35 views1 page

Other Content in This Stream: Wrap Up

The document discusses setting up an SSH connection to remotely control an Interbotix robot arm. It provides instructions to install ROS 2 on an AMD Kria board and run demo applications to control the robot arm from two terminal windows over the SSH connection.

Uploaded by

Gerard Papet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Other Content in This Stream: Wrap Up

The document discusses setting up an SSH connection to remotely control an Interbotix robot arm. It provides instructions to install ROS 2 on an AMD Kria board and run demo applications to control the robot arm from two terminal windows over the SSH connection.

Uploaded by

Gerard Papet
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

chmod +x xsarm_rpi4_install.

sh type
type $env:USERPROFILE\.ssh\id_rsa.pub
$env:USERPROFILE\.ssh\id_rsa.pub || ssh
ssh ubuntu@<board_ip>
ubuntu@<board_ip> "cat
"cat >>
>> .ssh/authorized_keys"
.ssh/authorized_keys"
./xsarm_rpi4_install.sh -d humble -j rx150 To establish a SSH connection from Visual Studio Code, we must first install the remote SSH option from the extensions (Figure 1).
To
To establish
establish aa SSH
SSH connection
connection from
from Visual
Visual Studio
Studio Code,
Code, we
we must first
first install the
the remote SSH option from
from the extensions (Figure 1).
(Figure
Demo Application NEWS MOUSER NEWS FEATURES must
Figure FOCUS
install
5: X Server NEW PRODUCTS
remote
extraSSH option(Source:
settings. theMouser
extensions
Electronics) 1).

With ROS 2 installed on the AMD Kria™ KR260 kit, we will run one of the provided demo applications. Open two terminal windows on
the KR260.
Figure 3: X Server display settings. (Source: Mouser Electronics)

To enable remote developmentFigure


1. In the first terminal window, enter the following command: and 1: SSH remote Once connection application. (Source: Mouser Electronics)
this is installed, we can connect to
visualization, wexsarm_control.launch.py
ros2 launch interbotix_xsarm_control must establishrobot_model:=rx150SSH this is installed,
Once theweAMD Kria to
can connect KR260
the AMDboard (Figure
Kria KR260 board2), which
(Figure 2), which will allow us to develop our applications
remotely in the KR260 file system.
connection and enable X11 forwarding.
2. In the second terminal, enter the following command: will allow us to develop our applications
python3 /home/ubuntu/interbotix_ws/src/interbotix_ros_manipulators/interbotix_ros_xsarms/interbo remotely in the KR260 file system.
tix_xsarm_control/demos/python_ros2_api/bartender.py
Figure 1: SSH
1. Use Windows Powershell Figure
Figure 1:
This will run an application that demonstrates the control of the robot arm.
1: SSH
SSH toremote
remote
remote
connection
install
connection application. (Source:
connection application.
(Source: MouserElectronics)
application. (Source: Mouser
Electronics)
Mouser Electronics)

Demo Breakdown
OpenSSH usingOnce the
Once following
this
Once this
is installed,
this is
is installed,
we can
installed, we
we can
connect to
can connect
to the AMD
connect to the
AMD Kria KR260
the AMD Kria
(Figure 2),which
KR260 board(Figure
board (Figure 2),
Kria KR260 board
which willallow
2), which will
allow ustotodevelop
will allow us
develop ourapplications
us to develop our
applications
our applications
commands. remotely
remotely in
in the
the KR260
KR260 file
file system.
system.
remotely in the KR260 file system.
By examining the code in this application, we can see how we can control the arm using the Python programming language. First, we

Get-WindowsCapability -Online |
need to import the InterbotixManipulatorXS arm package from the InterbotiX libraries we installed. To do this, enter the following Figure 4: X Server client startup settings. (Source: Mouser Electronics)
Where-Object Name -like 'OpenSSH*'
command: from interbotix_xs_modules.arm import InterbotixManipulatorXS

With these packages installed, we can start creating applications that manipulate the arm using a Python application.
# Install the OpenSSH Client
Figure
Looking at the example code, we can see the first thing we do is initialize it with the parameters 2:robot,
of the Establishing type,an
the model,Figure SSH
and2: remote connection.
itsEstablishing (Source:
an SSH remote Mouser
connection. Electronics)
end effector.  Add-WindowsCapability -Online -Name (Source: Mouser Electronics)
OpenSSH.Client~~~~0.0.1.0 To the becorrect
ablenumber
to use X11forforwarding, Figure
we must first 6:cXsrv
install X Server completed
Windows configurations.
X Server (available in(Source:
Figure 6: Xthe Mousersection)
Resources
Server Electronics)
completed on our
configurations.
With the robot (shown as bot in the code) defined, the application first checks the robot has of joints the demo.
(Source: Mouser Electronics)
# Install the OpenSSH Server
development machine. Run X Server and configure it as shown in the Figures 3–6.
Once it has been confirmed as being suitable for the demo, the robot is controlled by using several Python commands that set the
Connect to the display by running the following command in a command window on the development machine:
To be able to use X11 forwarding, we
pose, or single positions, as required. The gripper can also be opened and closed using Python calls.

 Add-WindowsCapability
bot = InterbotixManipulatorXS("rx150", "arm", "gripper") -Online -Name
OpenSSH.Server~~~~0.0.1.0Figure 2: must first (Source:
install cXsrv Windows
Electronics) X Server
set DISPLAY=127.0.0.1:0.0 Connect to the display by running the
if (bot.arm.group_info.num_joints < 5): Figure 2: Establishing an SSH remote connection.
Figure 2: Establishing
Establishing an SSH remote connection. (Source:
connection. (Source: Mouser
MouserElectronics)
Mouser Electronics)
 # Start the sshd service (available in the Resources We can then
section)
initiate an
on
SSH
our following
connection with the AMD
command
Kria
in a command
our KR260 board and start developing our robot applicatio
print('This demo requires the robot to have at least 5 joints!')
To
To be
Tobe able
beable
abletoto use
touse
useX11 forwarding, we
X11 forwarding, we must
must first
must first install
first install cXsrv
install cXsrvWindows
cXsrv WindowsXXXServer
Windows Server(available
Server (availablein
(available ininthe
theResources
the Resources
Resources section)
section)
section) on
on our
on
our
sys.exit() Start-Service sshd development
development machine. Run X Server
development
and configure it as
machine.
shown in the
Run
Figures
X
Figures3–6.
Server
3–6.
3–6.
and window on the development machine:
Figure 5: X Server extra settings. (Source: Mouser Electronics)
developmentmachine.
machine. Run X Server and
and configure
configure itit asas shown
shown in
in the Figures
sshthe-Y <user>@<board_ip>
# OPTIONAL but
bot.arm.set_ee_pose_components(x=0.3, recommended:/code>
z=0.2) configure it as shown in the Figures 3–6.
bot.arm.set_single_joint_position("waist", np.pi/2.0)

Set-Service -Name sshd -StartupType setyouDISPLAY=127.0.0.1:0.0
As this runs, the robot arm will move and will see a visualization of this movement on X Server (Figure 7).
bot.gripper.open()'Automatic'
 # Confirm the Firewall rule is
bot.arm.set_ee_cartesian_trajectory(x=0.1, z=-0.16)
We can then initiate an SSH connection
bot.gripper.close() configured. It should be created
automatically
Finally, the demo ends by safely byposition.
positioning the robot to its home setup. Run the with the AMD Kria KR260 board and start
following to verify
bot.arm.go_to_home_pose()
developing our robot application.
 if (!(Get-NetFirewallRule -Name
bot.arm.go_to_sleep_pose()
"OpenSSH-Server-In-TCP" -ErrorAction
Knowing this, we can start creating own custom applications, as shown in this video. But first, we need to be able to remotely develop
SilentlyContinue | Select-Object ssh -Y <user>@<board _ ip>
Figure 6: X Server completed configurations. (Source: Mouser Electronics)
applications on the AMD Kria™ KR260 board.
Name, Enabled)) { Connect to the display by running the following command in a command window on the development machine:

Remote Development Figure 3: X Server display settings. (Source: Mouser Electronics) set DISPLAY=127.0.0.1:0.0
 Write-Output "Firewall Rule As this runs, the robot arm will move
'OpenSSH-Server-In-TCP' does not We can then initiate an SSH connection with the AMD Kria KR260 board and start developing our robot application.
To develop our remote application, we will use Visual Studio Code on the development machine. The Python application we create
using Visual Studio Code onexist, creating
our development it..."
machine will be in the file system of the AMD Kria™ KR260 kit. This also has the benefit and you will see a visualization of this
ssh -Y <user>@<board_ip>
of requiring no connected display, keyboard, or mouse, as we can access everything from the development environment.
 New-NetFirewallRule -Name 'OpenSSH- movement on X Server (Figure 7).
As this runs, the robot arm will move and you will see a visualization of this movement on X Server (Figure 7).
We also want to be able to remotely view the visualization of the robot arm as we develop our application (in simulation mode or actual
execution). Server-In-TCP' -DisplayName 'OpenSSH
Server (sshd)' Figure Figure
-Enabled
Figure 3: XX Server
3:X True
Server display settings.
settings. (Source:
display settings. (Source: Mouser
Mouser Electronics)
Electronics)
3: Server display
To enable remote development and visualization, we must establish SSH connection and enable X11 forwarding.
(Source:
Figure 3:Mouser
X ServerElectronics)
display settings. (Source: Mouser Electronics)
-Direction Inbound -Protocol TCP
1. Use Windows Powershell-Action
to install OpenSSH Allow -LocalPort
using the following commands. 22

} else {
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

 Write-Output "Firewall rule


# Install the OpenSSH Client

'OpenSSH-Server-In-TCP' has been


Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

# Install
created and exists."
the OpenSSH Server

}
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

# Start the sshd service

Start-Service sshd
2. With OpenSSH installed, create a key
Figure 7: X Server robotic arm visualization (Source: Mouser Electronics)
using the following command.
# OPTIONAL but recommended:/code>

ssh-keygen
Set-Service -Name sshd -StartupType 'Automatic'
WrapMouser
Figure 4: X Server client startup settings. (Source: Up Electronics)
Figure 7: X Server robotic arm visualization (Source: Mouser Electronics)
# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the
following to verify Wrap Up Figure 7: X Server robotic arm visualization
Robotics can be complicated. In this project,
(Source:we haveElectronics)
Mouser seen that the AMD Kria™ KR260 kit can enable rapid devel
By default, the system will save the keys to
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-
solutions using ROS 2. TheRobotics
KR260 provides the ability to accelerate features within the programmable logic eleme
can be complicated. In this project, we have seen that the AMD Kria™ KR260 kit can enable rapid development of robotic
Object Name, Enabled)) {
C:\Users\<user>/.ssh/id _ rsa. solutions using ROS 2. The KR260 provides the ability to accelerate features within the programmable logic element or to integrate
further system control elements suchcontrol
as time-sensitive networking
networking within the programmable logic.
Wrap Up
Figure
Figure 4:
4: XX Server
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' Server client
client
does not startup
startup
exist, settings.
settings.
creating it..." (Source:
Figure
(Source: Mouser
4: X Server clientElectronics)
Mouser startup settings.
Electronics)
further system elements such as time-sensitive within the programmable logic.

Figure 4: X Server client startup settings. (Source:


(Source: MouserMouser Electronics)
Electronics) AMD, and the AMD Arrow logo, Kria, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used herein are for identification
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -
3. Exchange keys using the following
Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
AMD, and the AMD Arrow logo, Kria, andandcombinations
purposes may be trademarks of thereof are
their respective trademarks of Advanced Micro Devices, Inc. Other product names used he
owners.

purposes and may be trademarks of their respective owners.


} else { command. Robotics can be complicated. In this
About the Author
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
 ype $env:USERPROFILE\.ssh\id _ rsa.
t project, we have seen that the AMD Kria™
Adam Taylor is a professor of embedded systems, engineering leader, and world-recognized expert in
}
pub | ssh ubuntu@<board _ ip> "cat >> KR260 kit can enable rapid development
FPGA/System on Chip and Electronic Design.

With OpenSSH installed,.ssh/authorized _ keys" About the Author


of robotic solutions using ROS 2. The
2. create a key using the following command.
More Content by Adam Taylor

ssh-keygen
Adam Taylor is a professor of
KR260systems,
embedded
provides the ability to accelerate
engineering leader, and world-recognized expert in
By default, the system will save the keys to C:\Users\<user>/.ssh/id_rsa.
To establish a SSH connection from Visual FPGA/System on Chip and Electronic features
Design.within the programmable logic
3. Exchange keys using the following command.
Studio Code, we must first install the element or to integrate further system NEXT ARTICLE
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh ubuntu@<board_ip> "cat >> .ssh/authorized_keys"
remote SSH option from the extensions More Content by Adam Taylor control elements such as time-sensitive
NO PREVIOUS ARTICLES The Acoustic Swarm Revolutio…
Discover how a swarm of tiny, intelligent spe…
Figure
To establish a SSH connection from Visual Studio Code, we must first install the remote SSH option 5:
fromXtheServer extra
extensions (Figuresettings.
1). (Source: Mouser Electronics)
(Figure 1). networking within the programmable
logic.
Return to Home

Figure
Figure 5:
5: XX Server
Server extra
extra settings.
settings. (Source: Mouser Electronics)
(Source:
FigureMouser Electronics)
5: X Server Other
extra settings. (Source: Mouser Electronics) content in this Stream
Figure 5: X Server extra settings. (Source: Mouser Electronics)
Figure 1: SSH remote connection application. (Source: Mouser Electronics) NEXT ARTICLE
Figure 1: SSH remote connection application.
Once this is installed, we can connect to the AMD Kria KR260 board (Figure 2), which will allow us to develop our applications
(Source: Mouser Electronics) NO PREVIOUS ARTICLES The Acoustic Swar
remotely in the KR260 file system.
Discover how a swarm of t

BLOG Revolutionizing Ambient Power: ARTICLE

The Acoustic Swarm Logistics: The Age of Energy-Harvesting Industry 5.0


Revolutionizing Audio AI Truck Loading Robots Circular Eco
Clarity Robots

Return to Home
Figure 2: Establishing an SSH remote connection. (Source: Mouser Electronics) Read Blog » Read Article » Read Article » Read Article »

To be able to use X11 forwarding, we must first install cXsrv Windows X Server (available in the Resources section) on our
24 April 2024 www.mouser.com
development machine. Run X Server and configure it as shown in the Figures 3–6.
Other content in this Stream
Figure 6: X Server completed configurations. (Source: Mouser Electronics)

You might also like