-
Notifications
You must be signed in to change notification settings - Fork 27
Running Rviz on Windows
ROS For Windows
- Install Chocolatey https://chocolatey.org/install Here are the condensed steps:
- Start a PowerShell terminal AS ADMINISTRATOR
- Run
Get-ExecutionPolicy
. If it returnsRestricted
, then runSet-ExecutionPolicy Bypass
- Note, this is a bit of a security issue, but it works. See here if you have concerns.
- Then run this to install
choco
:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- ROS for Windows http://wiki.ros.org/Installation/Windows I am skipping steps that I don't need. My goal isn't a "full development environment", just to be able to use basic ROS built-in tools.
- Install git:
choco upgrade git -y
- Install ROS. This is copied directly from the above web site.
mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1
choco upgrade ros-noetic-desktop_full -y --execution-timeout=0
- Download a copy of the navigation.rviz file for use in Windows
Go to: https://github.com/chrisl8/ArloBot/blob/noetic/arlobot_ros/rviz/navigation.rviz Click on the "Raw" button. In the browser do what you need to in order to download it:
- Typically Right click on the page ans select "Save as"
- If it tries to add a .txt extention, REMOVE that so that it ends in .rviz
- Save it somewhere easy to find.
Check the file and make sure that it does NOT have a .txt extension, if it does, fix it.
- Run Rviz
- Get the IP Address of the Robot, and also of this Windows machine.
- Open a Command Promt (cmd, NOT PowerShell) doesn't need to be administrator and run:
- Replace "192.168.1.ROBOT" with the robot's IP address.
- Replace "192.168.1.ME" with the IP address if THIS Windows system.
c:\opt\ros\noetic\x64\setup.bat
set ROS_MASTER_URI=http://192.168.1.ROBOT:11311
set ROS_HOSTNAME=192.168.1.ME
set ROS_IP=192.168.1.ME
c:\opt\ros\noetic\x64\bin\rviz.exe
Rviz should load momentarily.
- Click on File->Open Config
- Find the downloaded navigation.rviz file and open it.
Just like on Linux, if you do NOT have it making a map yet, select "odom" as the "Fixed Frame", or if you do have the map maker running, then leave it or change Fixed From back to "map".
You can make a batch file to run that will start up Rviz easily just by double click it.
Make a file anywhere, like your Desktop, called Rviz.bat
. The name has to end in .bat
but otherwise anything will work.
Then put these contents in, replacing the IP's with the correct ones for you and replacing the path to navigation.rviz
with the correct one:
call c:\opt\ros\noetic\x64\setup.bat
set ROS_MASTER_URI=http://192.168.1.118:11311
set ROS_HOSTNAME=192.168.1.45
set ROS_IP=192.168.1.45
c:\opt\ros\noetic\x64\bin\rviz.exe -d "c:\Users\chris\Downloads\navigation.rviz"
Note the use of call
in the first line. This ensures the batch file runs the other batch file "inside" this one. Without using call
it will just run the other batch file and exist without doing anything.
Everything else is the same as if you ran it by hand.