Wednesday, May 6, 2020

Installing ROS on a Raspberry Pi- Part 2

In the previous post, we installed Raspbian 'buster' and ROS 'melodic' onto a Raspberry Pi; here we will test its functionality.

Login to the RPi

Since as part of the Raspbian install we enabled 'headless' mode, let's access its desktop using the 'VNC Viewer' client.
  • Download and install vnc viewer.
  • Find the IP address of your Raspberry Pi on your network.
    • Open a CMD or terminal window on your computer and run the command 'arp -a' and look for the Raspberyy Pi's physical MAC address that starts with 'b8-27-eb' (we can take advantage of the 'pipe' and 'findstr' commands in the Windows 10 Command Prompt to filter the results returned):
> arp -a | findstr " b8-27-eb-"
    192.168.1.126         b8-27-eb-3b-f2-90     dynamic
  • Use the IP address found to login to the Raspberry Pi via VNC Viewer:
  • You will need to enter the password for the 'pi' user that you created as part of the Raspbian configuration steps you did in the first part of this series.

  • Now that we have access to the desktop on the headless system, we can use our local keyboard and mouse as if we were on the system itself. Note that when there is no physical display connected to the Raspberry Pi, it will default to a low-resolution desktop. To get a HD display, you will need to edit the /boot/config.txt file as follows:
    • Un-comment the following lines:
      • hdmi_force_hotplug=1
      • hdmi_group=1
      • hdmi_drive=2
    • Edit the following line to change the value from '1' to '16' to force display to 16:9 1080p
      • hdmi_mode=16
    • Comment out the following line:
      • dtoverlay=vc4-fkms-v3d

Check the ROS installation

  • Open a terminal session and create a catkin workspace in your home directory:
$ mkdir -p ~/catkin_ws/src  
$ cd ~/catkin_ws/  
$ catkin_make
$ source devel/setup.bash
  • Run 'roscore' to check the install:
$ roscore
... logging to /home/pi/.ros/log/8e91c8a2-8fdf-11ea-a15e-b827eb3bf290/roslaunch-rospi-8768.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://rospi:35989/
ros_comm version 1.14.5

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.5

NODES

auto-starting new master
process[master]: started with pid [8778]
ROS_MASTER_URI=http://rospi:11311/

setting /run_id to 8e91c8a2-8fdf-11ea-a15e-b827eb3bf290
process[rosout-1]: started with pid [8790]
started core service [/rosout]
  • Use <CTL>- C to exit roscore
  • Continue on with these ROS tutorials.





No comments:

Post a Comment