Setup Notepad++ to remotely edit GoPiGo2 files

The Dexter website has instructions on how to do this but I want to summarize it again here with some small changes. https://www.dexterindustries.com/BrickPi/brickpi-tutorials-documentation/program-it/hints-and-tricks/

1) Open Notepad++ and add NppFTP plugin if you don’t already have it.

  1. Plugins -> Plugin Manager -> Show Plugin Manager
  2. Find NppFTP and install it.

2) “Show NppFTP Window” in the Plugins dropdown.

3) Click the gear symbol and then “Profile settings”

4) Add a new profile. Call it “GoPiGo” or any other name and edit the following fields:

Hostname: dex.local
Connection type: SFTP
Port: 22
Username: pi
Password: robots1234  (or your new password)
Initial remote directory: /home/pi  (or your preferred directory)

5) Authorize remote editing on Raspberry Pi.

On Raspberry Pi, open a terminal and enter this:

sudo find /home/pi -type d -exec chmod 777 {} \;

This will make everything editable. If you only want to set specific files then replace “/home/pi” with another file or folder.

Scanse.io Sweep Lidar installation on GoPiGo2

I’m writing this the day after completing the setup so I may have forgotten some part of the process. I believe it went like this:

 Image

Clone the Sweep-SDK Repository

Log in to the Raspberry PI OS. Open a terminal and clone the sweep repo.

git clone https://github.com/scanse/sweep-sdk

Install CMAKE

Install CMAKE on Raspberry Pi in order to build `libsweep.so` in *sweep-sdk*.
Replace the version number with the latest, which in my case was 3.8.1 (https://cmake.org/download/).

INSTRUCTIONS FROM: http://osdevlab.blogspot.tw/2015/12/how-to-install-latest-cmake-for.html

1. Create a folder

pi@raspberrypi ~ $ mkdir Download
pi@raspberrypi ~ $ cd Download

2. Download the compressed file and extract it

pi@raspberrypi ~/Download $ wget https://cmake.org/files/v3.8/cmake-3.8.1.tar.gz
pi@raspberrypi ~/Download $ tar -xvzf cmake-3.8.1.tar.gz

3. Compile and install cmake. This will take several minutes.

pi@raspberrypi ~/Download $ cd cmake-3.4.1/
pi@raspberrypi ~/Download/cmake-3.4.1 $ sudo ./bootstrap
pi@raspberrypi ~/Download/cmake-3.4.1 $ sudo make
pi@raspberrypi ~/Download/cmake-3.4.1 $ sudo make install

Install libsweep

INSTRUCTIONS FROM: https://github.com/scanse/sweep-sdk/tree/master/libsweep

1. Enter the libsweep directory

cd sweep-sdk/libsweep

2. Create and enter a build directory

mkdir -p build
cd build

3. Build and install the libsweep library

cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
sudo cmake --build . --target install
sudo ldconfig

Install SweepPy

INSTRUCTIONS FROM: https://github.com/scanse/sweep-sdk/tree/master/sweeppy

1. Go to the `sweep-sdk/sweeppy` folder where `setup.py` is located.
2. Install sweep for python. (I don’t know if both versions is necessary but that’s what I did.)

python3 setup.py install --user
sudo python setup.py install --user

Run Sample Code

1. Connect Scanse Sweep to USB. I used the center top USB port for the Scanse lidar.

2. Run some code. (I skipped trying to add the `sweep` module globally and just wrote my test file inside the `sweeppy` folder.)

from sweeppy import Sweep

with Sweep('/dev/ttyUSB0') as sweep:
    print(sweep.get_motor_speed())
    print(sweep.get_sample_rate())
    sweep.start_scanning()

    for scan in sweep.get_scans():
        print('{}\n'.format(scan))

Note:

You cannot “get” or “set” while scanning. Do it before “start_scanning()” or after “stop_scanning()”.