Skip to content

Commit 6d8cb22

Browse files
author
Demo User
committed
allow systemd services to be enabled by default, plus various little renames and polishes
1 parent 60905c7 commit 6d8cb22

26 files changed

+63
-145
lines changed

debian/postinst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
set -e # exit on error
66
. /usr/share/debconf/confmodule # Source debconf library.
77

8+
9+
# enable services, but don't start yet
10+
systemctl daemon-reload
11+
systemctl enable robotcontrol
12+
systemctl enable rc_battery_monitor
13+
14+
# in interactive mode, ask for configuration options
815
if [ ! "$DEBIAN_FRONTEND" = "noninteractive" ] ; then
916

1017
# Fetching configuration from debconf
@@ -30,34 +37,30 @@ if [ ! "$DEBIAN_FRONTEND" = "noninteractive" ] ; then
3037
echo "setting nothing to run on boot"
3138
rm -f /etc/robotcontrol/link_to_startup_program
3239
else
33-
echo "leaving current robotcontrol startup program alone"
40+
echo "leaving current robot control startup program alone"
3441
fi
3542

36-
# enable services
37-
echo "systemctl daemon-reload"
38-
systemctl daemon-reload
39-
echo "Enabling robotcontrol Service"
40-
systemctl enable robotcontrol
41-
echo "Enabling rc_battery_monitor Service"
42-
systemctl enable rc_battery_monitor
43-
# try to start battery monitor, but ignore errors as this may not work
44-
echo "Starting rc_battery_monitor Service"
43+
44+
# try to start services, but ignore errors as this may not work
4545
set +e
4646
systemctl start rc_battery_monitor
47+
systemctl start robotcontrol
4748

4849
# leave error checking off when setting up device tree too
4950
if [ "$ENABLE_DT" = "true" ]; then
5051
echo "Configuring Device Tree"
5152
configure_robotics_dt
5253
fi
5354

54-
echo "Robotics Cape package installation complete."
55-
55+
echo "**********************************************"
56+
echo "librobotcontrol package installation complete."
5657
if [ "$ENABLE_DT" = "true" ]; then
57-
echo "**********************************************"
5858
echo "Please reboot now to load new device tree."
59-
echo "**********************************************"
6059
fi
60+
echo "**********************************************"
61+
62+
# put error checking back on in case debhelper wants it
63+
set -e
6164

6265
fi
6366

debian/rules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44

55
override_dh_fixperms:
66
dh_fixperms \
7-
--exclude var/lib/robotcontrol \
8-
--exclude var/run/robotcontrol
7+
--exclude var/lib/robotcontrol
98

examples/src/rc_balance.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <unistd.h> // for isatty()
99
#include <stdlib.h> // for strtof()
1010
#include <math.h> // for M_PI
11-
#include <roboticscape.h>
11+
#include <robotcontrol.h>
1212

1313
#include "rc_balance_defs.h"
1414

@@ -474,7 +474,7 @@ void balance_controller()
474474
* read sensors and compute the state when either ARMED or DISARMED
475475
******************************************************************/
476476
// angle theta is positive in the direction of forward tip around X axis
477-
cstate.theta = mpu_data.dmp_TaitBryan[TB_PITCH_X] + CAPE_MOUNT_ANGLE;
477+
cstate.theta = mpu_data.dmp_TaitBryan[TB_PITCH_X] + BOARD_MOUNT_ANGLE;
478478

479479
// collect encoder positions, right wheel is reversed
480480
cstate.wheelAngleR = (rc_encoder_eqep_read(ENCODER_CHANNEL_R) * 2.0 * M_PI) \

examples/src/rc_balance_defs.h

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,14 @@
1111
#define DT 0.01 // 1/sample_rate
1212

1313
// Structural properties of eduMiP
14-
#define CAPE_MOUNT_ANGLE 0.49 // increase if mip tends to roll forward
14+
#define BOARD_MOUNT_ANGLE 0.49 // increase if mip tends to roll forward
1515
#define GEARBOX 35.577
1616
#define ENCODER_RES 60
1717
#define WHEEL_RADIUS_M 0.034
1818
#define TRACK_WIDTH_M 0.035
1919
#define V_NOMINAL 7.4
2020

21-
/*
22-
// inner loop controller 200hz old
23-
#define D1_GAIN 0.8
24-
#define D1_ORDER 2
25-
#define D1_NUM {-6.289, 11.910, -5.634 }
26-
#define D1_DEN { 1.000, -1.702, 0.702 }
27-
#define D1_NUM_LEN 3
28-
#define D1_DEN_LEN 3
29-
#define D1_SATURATION_TIMEOUT 0.5
30-
31-
// outer loop controller original 200hz
32-
#define D2_GAIN 0.7
33-
#define D2_ORDER 1
34-
#define D2_NUM { 0.3858, -0.3853 }
35-
#define D2_DEN { 1.0000, -0.9277 }
36-
#define D2_NUM_LEN 2
37-
#define D2_DEN_LEN 2
38-
#define THETA_REF_MAX 0.37
39-
*/
40-
41-
// // inner loop controller 100hz new
21+
// inner loop controller 100hz
4222
#define D1_GAIN 1.05
4323
#define D1_ORDER 2
4424
#define D1_NUM {-4.945, 8.862, -3.967}
@@ -48,7 +28,7 @@
4828
#define D1_SATURATION_TIMEOUT 0.4
4929

5030

51-
// outer loop controller new 100hz
31+
// outer loop controller 100hz
5232
#define D2_GAIN 0.9
5333
#define D2_ORDER 2
5434
#define D2_NUM {0.18856, -0.37209, 0.18354}

examples/src/rc_bind_dsm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**
22
* @example rc_bind_dsm
33
*
4-
* routine to put a DSM2/DSMX satellite receiver into pairing mode James
5-
* Strawson 2014
4+
* routine to put a DSM2/DSMX satellite receiver into pairing mode
65
*
76
* DSM satellite receivers are put into bind mode by sending them a sequence of
87
* pulses right after it receives power and starts up. This program puts the

examples/src/rc_blink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @example rc_blink
44
*
55
* This is an example program to demonstrate use of LEDs and button handlers in
6-
* the robotics cape API. Once started, blink will flash the green and red LEDs.
6+
* the Robot Control API. Once started, blink will flash the green and red LEDs.
77
* Pressing the mode button will cycle through 3 blinking speeds, slow medium,
88
* and fast. Momentarily pressing the pause button will stop and start the
99
* blinking by toggling the global state between PAUSED and RUNNING. If the user

examples/src/rc_calibrate_accel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// change this for your platform
2222
#define I2C_BUS 2
2323

24-
int main(){
25-
24+
int main()
25+
{
2626
printf("\nThis program will generate a new accelerometer calibration file\n");
2727
printf("Press any key to continue\n");
2828
getchar();

examples/src/rc_calibrate_dsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
int main()
1818
{
19-
printf("Please connect a DSM satellite receiver to your Robotics Cape\n");
20-
printf("and make sure your transmitter is on and paired to the receiver\n");
19+
printf("Please connect a DSM satellite receiver and make sure\n");
20+
printf("your transmitter is on and paired to the receiver.\n");
2121
printf("\n");
2222
printf("Press ENTER to continue or anything else to quit\n");
2323
getchar();

examples/src/rc_calibrate_gyro.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
#include <stdio.h>
1818
#include <rc/mpu.h>
1919

20-
// bus for Robotics Cape and BeagleboneBlue is 2
20+
// bus for Robotics Cape and BeagleBone Blue is 2
2121
// change this for your platform
2222
#define I2C_BUS 2
2323

24-
int main(){
25-
24+
int main()
25+
{
2626
printf("\nThis program will generate a new gyro calibration file\n");
27-
printf("keep your beaglebone very still for this procedure.\n");
27+
printf("keep your board very still for this procedure.\n");
2828
printf("Press any key to continue\n");
2929
getchar();
3030
printf("Starting calibration routine\n");

examples/src/rc_calibrate_mag.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
// change this for your platform
2121
#define I2C_BUS 2
2222

23-
int main(){
23+
int main()
24+
{
2425

2526
printf("\n");
2627
printf("This will sample the magnetometer for the next 15 seconds\n");
27-
printf("Rotate the cape around in the air through as many orientations\n");
28+
printf("Rotate the board around in the air through as many orientations\n");
2829
printf("as possible to collect sufficient data for calibration\n");
2930
printf("Press any key to continue\n");
3031
getchar();

0 commit comments

Comments
 (0)