ProgrammingRobotsStudyGroup / robo_magellan

Apache License 2.0
4 stars 6 forks source link

:imagesdir: ./doc/images :toc: macro

= PRSG RoboMagellan ROS node

== What's in the repository? The current use of this repository is to simulate a ROS node for the purposes of developing automated build. link:http://programmingrobotsstudygroup.github.io/2017RoboMagellan.html[See PRSG's project website for project details]

== This Repository is integrated with Jenkins! Continuous Integration Etiquette:

== Prepare your System

=== 1. Install Ubuntu and ROS to UP and Test

=== 2. Install Chrony Chrony implements Network Time Protocol, (NTP), in order to keep your system clock accurate. It is designed to work with intermittent network connections.

sudo apt-get install chrony

=== 3. Make a catkin workspace The script in a later step will expect to use an existing catkin workspace named "catkin_ws". If you haven't already created this please follow the steps link:http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment[here]. These are summarized below for convenience:

$ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src $ catkin_init_workspace $ cd ~/catkin_ws/ $ catkin_make

Resolve the opencv dependency by installing:

sudo apt-get install ros-kinetic-video-stream-opencv

Resolve the python smbus dependency by installing:

sudo apt-get install python-smbus

Optional. Lidar support with rpilidar:

Optional. Generate messages for java platform:

genjava_message_artifacts --verbose

Finally add

source ~/catkin_ws/devel/setup.bash

to your ~/.bashrc file.

=== 4. Configure Zeroconf Add this line to your .bashrc file on the UP and your development machine. Reboot.

export ROS_HOSTNAME=echo $HOSTNAME.local

Reboot the machine and test configuration from both ends. If you named your machine 'robot' as advised in Intel documents, you should be able to ping the robot's processor from your machine. Substitue robot for your machine name if ou elected to use a different name.

$ ping robot.local

To test your laptop/development machine,

$ ssh robot@robot.local $ robot@robot.local's password: robot@robot:~$ ping my_machine.local

=== 5. Shutdown Switch This step describes how to set up a pushbutton switch to gracefully shut down the UP. This may help avoid flash corruption.

Install Rpi.GPIO. Try this first:

sudo apt-get install python-rpi.gpio

If that doesn't work

$ dpkg -L python-rpi.gpio $ wget http://ubilinux.com/ubilinux/pool/main/r/rpi-gpio/python-rpi.gpio_0.6.2%2bubi2-1_amd64.deb $ sudo dpkg -i python-rpi.gpio_0.6.2+ubi2-1_amd64.deb $ sudo groupadd gpio $ sudo adduser robot gpio $ pico /etc/udev/rules.d99-gpio.rules SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660" SUBSYSTEM=="gpio", KERNEL=="gpiochip", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/une SUBSYSTEM=="gpio", KERNEL=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge

The file 99-gpio.rules can be found in the doc directory.

Add python /home/robot/catkin_ws/src/robo_magellan/scripts/shutdownSwitch.py & to the UP in /etc/rc.local just before the existing exit 0 line.

The shutdownSwitch.py script assumes a momentary, normally open switch is connected from UP board pin 18 to ground (pin 20). You may also need an external 10k pullup resistor from pin 18 to 3.3 V (pin 17). A fragment of the link:https://up-community.org/wiki/Pinout[UP pinout] is included here for clarity.

image::switch-pins.PNG[width="400", height="300"]

=== 6. Get the Code You will need ROS Kinetic installed on your machine.

Install link:https://github.com/mavlink/mavros/blob/master/mavros/README.md[MAVROS]. Just use apt-get.

sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras

If you haven't already done so, start by fetching the repository.

Edit: 1/24/18 (Errors occurring when re-starting Vicky after 9 months.)

Then install GeographicLib datasets by running the install_geographiclib_datasets.sh script:

wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh ./install_geographiclib_datasets.sh


cd catkin_ws/src git clone https://github.com/ProgrammingRobotsStudyGroup/robo_magellan.git

If you already have the repository, make sure it's up to date

cd catkin_ws/src git pull

Then run the installation/update script:

roscd robo_magellan ./victoria.sh