@@ -43,16 +43,6 @@ float Bvoltages[2];
43
43
44
44
// updates thrusters' pwm signals from array
45
45
void updateThrusters (const uint16_t microseconds[8 ]) {
46
- <<<<<<< PowerBoardRos
47
- thrusters[BACK_L].writeMicroseconds (microseconds[BACK_L]);
48
- thrusters[HEAVE_BACK_L].writeMicroseconds (microseconds[HEAVE_BACK_L]);
49
- thrusters[HEAVE_FRONT_L].writeMicroseconds (microseconds[HEAVE_FRONT_L]);
50
- thrusters[FRONT_L].writeMicroseconds (microseconds[FRONT_L]);
51
- thrusters[FRONT_R].writeMicroseconds (microseconds[FRONT_R]);
52
- thrusters[HEAVE_FRONT_R].writeMicroseconds (microseconds[HEAVE_FRONT_R]);
53
- thrusters[BACK_R].writeMicroseconds (microseconds[BACK_R]);
54
- thrusters[HEAVE_BACK_R].writeMicroseconds (microseconds[HEAVE_BACK_R]);
55
- =======
56
46
thrusters[BACK_L].writeMicroseconds (microseconds[BACK_L]);
57
47
thrusters[HEAVE_BACK_L].writeMicroseconds (microseconds[HEAVE_BACK_L]);
58
48
thrusters[HEAVE_FRONT_L].writeMicroseconds (microseconds[HEAVE_FRONT_L]);
@@ -61,32 +51,15 @@ void updateThrusters(const uint16_t microseconds[8]) {
61
51
thrusters[HEAVE_FRONT_R].writeMicroseconds (microseconds[HEAVE_FRONT_R]);
62
52
thrusters[BACK_R].writeMicroseconds (microseconds[BACK_R]);
63
53
thrusters[HEAVE_BACK_R].writeMicroseconds (microseconds[HEAVE_BACK_R]);
64
- >>>>>>> main
65
54
}
66
55
67
56
// updates microseconds array with values from ros
68
57
void commandCb (const auv_msgs::ThrusterMicroseconds &tc) {
69
- <<<<<<< PowerBoardRos
70
- memcpy (microseconds, tc.microseconds , 8 * sizeof (uint16_t ));
71
- =======
72
58
memcpy (microseconds, tc.microseconds , 8 * sizeof (uint16_t ));
73
- >>>>>>> main
74
59
}
75
60
76
61
// attaches and arms thrusters
77
62
void initThrusters () {
78
- <<<<<<< PowerBoardRos
79
- thrusters[BACK_L].attach (BACK_L_PIN);
80
- thrusters[HEAVE_BACK_L].attach (HEAVE_BACK_L_PIN);
81
- thrusters[HEAVE_FRONT_L].attach (HEAVE_FRONT_L_PIN);
82
- thrusters[FRONT_L].attach (FRONT_L_PIN);
83
- thrusters[FRONT_R].attach (FRONT_R_PIN);
84
- thrusters[HEAVE_FRONT_R].attach (HEAVE_FRONT_R_PIN);
85
- thrusters[HEAVE_BACK_R].attach (HEAVE_BACK_R_PIN);
86
- thrusters[BACK_R].attach (BACK_R_PIN);
87
-
88
- updateThrusters (offCommand);
89
- =======
90
63
thrusters[BACK_L].attach (BACK_L_PIN);
91
64
thrusters[HEAVE_BACK_L].attach (HEAVE_BACK_L_PIN);
92
65
thrusters[HEAVE_FRONT_L].attach (HEAVE_FRONT_L_PIN);
@@ -97,7 +70,6 @@ void initThrusters() {
97
70
thrusters[BACK_R].attach (BACK_R_PIN);
98
71
99
72
updateThrusters (offCommand);
100
- >>>>>>> main
101
73
}
102
74
103
75
// sets up ros publisher and subscriber nodes
@@ -114,7 +86,6 @@ void senseVoltage(float Bvoltages[]) {
114
86
115
87
// updates values sensed onto the ros nodes and publishes them
116
88
void publishVoltages () {
117
- <<<<<<< PowerBoardRos
118
89
senseVoltage (Bvoltages);
119
90
120
91
batt1_voltage_msg.data = Bvoltages[0 ];
@@ -134,44 +105,14 @@ void setup() {
134
105
nh.subscribe (sub);
135
106
nh.advertise (batt1_voltage);
136
107
nh.advertise (batt2_voltage);
137
- =======
138
- senseVoltage (Bvoltages);
139
-
140
- batt1_voltage_msg.data = Bvoltages[0 ];
141
- batt2_voltage_msg.data = Bvoltages[1 ];
142
-
143
- batt1_voltage.publish (&batt1_voltage_msg);
144
- batt2_voltage.publish (&batt2_voltage_msg);
145
- }
146
-
147
- void setup () {
148
- initThrusters ();
149
-
150
- pinMode (VBAT1_SENSE, INPUT);
151
- pinMode (VBAT2_SENSE, INPUT);
152
-
153
- nh.initNode ();
154
- nh.subscribe (sub);
155
- nh.advertise (batt1_voltage);
156
- nh.advertise (batt2_voltage);
157
- >>>>>>> main
158
108
}
159
109
160
110
void loop () {
161
111
updateThrusters (microseconds);
162
112
163
- <<<<<<< PowerBoardRos
164
113
publishVoltages ();
165
114
166
115
nh.spinOnce ();
167
116
168
117
delay (10 );
169
118
}
170
- =======
171
- publishVoltages ();
172
-
173
- nh.spinOnce();
174
-
175
- delay (10 );
176
- }
177
- >>>>>>> main
0 commit comments