Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Thanksgiving] Add upstart rule that kinda-sorta-works

  • Loading branch information...
commit 85569d64f4a139fd632938ed9028a8ca4cd9bf26 1 parent d60ad0e
@garbear authored
View
2  avr_controller/src/GPIO.cpp
@@ -35,7 +35,7 @@
#include <unistd.h> // for I/O functions
#define SYSFS_GPIO_DIR "/sys/class/gpio"
-#define EXPORT_COMMAND "`rospack find avr_controller`/bin/gpio_export %d"
+#define EXPORT_COMMAND "./gpio_export %d" // in current bin directory
#ifndef INVALID_SOCKET
#define INVALID_SOCKET -1
View
7 avr_controller/src/Thanksgiving.cpp
@@ -30,7 +30,7 @@
#include <iostream>
-#define SHUTDOWN_COMMAND "`rospack find avr_controller`/bin/system_shutdown"
+#define SHUTDOWN_COMMAND "./system_shutdown" // in current bin directory
#define ARDUINO_PORT "/dev/ttyACM0"
#define BUTTON_TIMEOUT 5000000UL // 5.0s
//#define POWER_TIMEOUT 5000000UL // 5.0s
@@ -46,6 +46,9 @@ int main(int argc, char **argv)
}
void Thanksgiving::Main()
{
+ // Wait 30 seconds
+ usleep(60000000L);
+
// Connect to the Arduino
arduino.Open(ARDUINO_PORT);
@@ -89,6 +92,8 @@ void Thanksgiving::GreenThreadRun()
ParamServer::BatteryMonitor bm;
string fsm = bm.GetString();
+ arduino.DestroyFSM(fsm); // Make sure FSM isn't running before we start
+
enum STATE
{
ENABLED = 0,
View
6 avr_controller/thanksgiving.conf
@@ -8,7 +8,7 @@ author "Garrett Brown"
#start on started mountall
# If network interface is wireless
#start on (local-filesystems and net-device-up IFACE=wlan0)
-start on virtual-filesystems
+start on (local-filesystems and virtual-filesystems)
# If network interface is Ethernet uncomment below line and comment above line
#start on (local-filesystems and net-device-up IFACE=eth0)
@@ -20,8 +20,8 @@ respawn limit 99 5
script
# Not sure why $HOME is needed, but we found that it is:
- export HOME="/home/garrett/ros/mecanum/avr_controller"
- exec $HOME/bin/thanksgiving
+ chdir /home/garrett/ros/mecanum/avr_controller/bin
+ exec ./thanksgiving
end script
post-start script
Please sign in to comment.
Something went wrong with that request. Please try again.