Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Zareen Choudhury committed Jan 25, 2018
2 parents bfe410f + 43285f5 commit 594a7e4
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 6 deletions.
52 changes: 46 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,55 @@
# Canopy Cloud Robotics Framework
This is the ROS node for the client-side application.
# Canopy Client
This is the ROS node for the client-side application of Canopy.

## Installation
```
cd <YOUR CATKIN WORKSPACE>/src
git clone https://github.com/baalexander/rospy_message_converter
git clone https://github.com/canopy-ros/canopy_client
cd canopy_client
pip install -r requirements.txt
. ./canopy_client_install.sh
```

## Clock Synchronization
This section describes the _client-side_ instructions for synchronizing the clocks of your Canopy clients and the Canopy server using `chrony`.

### Setting up chrony
Modify the chrony configuration file `/etc/chrony/chrony_canopy_client.conf` to reflect your Canopy server's IP address:
```
# /etc/chrony/chrony_canopy_client.conf
server 128.31.37.168
...
```
Disable and stop the default chrony service:
```
sudo systemctl stop chrony
sudo systemctl disable chrony
```

cd <YOUR CATKIN WORKSPACE>
catkin_make
. ./devel/setup.bash
Enable and start the Canopy chrony service:
```
sudo systemctl enable chrony_canopy_client
sudo systemctl start chrony_canopy_client
```

### Checking chrony setup
To check whether the service is running correctly, run `systemctl status chrony_canopy_client` which should show an active running status:
```
chrony_canopy_client.service - chrony service for canopy client
Loaded: loaded (/lib/systemd/system/chrony_canopy_client.service; static; vendor preset: enabled)
Active: active (running)
...
```

To check whether the chrony daemon `chronyd` is working correctly, first setup chrony on the [Canopy server](https://github.com/canopy-ros/canopy_server_startup/) and ensure that it is running correctly. Then run `chronyc activity` on the client which should return the following:
```
200 OK
1 sources online
0 sources offline
0 sources doing burst (return to online)
0 sources doing burst (return to offline)
0 sources with unknown address
```
If you see the message `506 Cannot talk to daemon`, then `chronyd` is not running properly.

Finally run `chronyc sources` and you should see your Canopy server's IP address listed. If you are connecting the chrony client to the chrony server for the first time, it may take several minutes before the correct IP is listed under sources.
27 changes: 27 additions & 0 deletions canopy_client_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh
CANOPY_CLIENT_DIR=$(pwd)

# trap errors
function err_fn() {
echo 'ERROR - aborting script.'
cd $CANOPY_CLIENT_DIR
trap - ERR
}
trap "err_fn; return" ERR

# install python packages
pip install -r requirements.txt

# setup chrony
sudo apt-get update
sudo apt-get install chrony
sudo cp chrony_canopy_client.service /lib/systemd/system
sudo cp chrony_canopy_client.conf /etc/chrony

# make ros package
cd ../..
catkin_make
. ./devel/setup.bash
cd $CANOPY_CLIENT_DIR
trap - ERR
echo "SUCCESS - script successfully installed."
15 changes: 15 additions & 0 deletions chrony_canopy_client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To synchronize client to server, uncomment line below and replace IP with server's IP:
# server 123.123.12.12 iburst

maxupdateskew 5

driftfile /var/lib/chrony/chrony.drift

dumponexit
dumpdir /var/log/chrony

rtcsync

keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
12 changes: 12 additions & 0 deletions chrony_canopy_client.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description = chrony service for canopy client
Conflicts = ntpd.service

[Service]
Type = forking
Restart = always
PIDFile = /var/run/chronyd.pid
ExecStart = /usr/sbin/chronyd -f /etc/chrony/chrony_canopy_client.conf -r -s

[Install]
WantedBy = default.target

0 comments on commit 594a7e4

Please sign in to comment.