Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit f1699fe

Browse files
Merge pull request #2 from project-march/feature/PM-285-control-led
Feature: control RGB LED
2 parents 17262fe + 85ed8ad commit f1699fe

File tree

9 files changed

+110
-541
lines changed

9 files changed

+110
-541
lines changed

.vscode/extensions.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{
2-
// See http://go.microsoft.com/fwlink/?LinkId=827846
3-
// for the documentation about the extensions.json format
4-
"recommendations": [
5-
"platformio.platformio-ide"
6-
]
7-
}
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"platformio.platformio-ide"
6+
]
7+
}

include/color.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef COLOR_H
2+
#define COLOR_H
3+
#include <Arduino.h>
4+
5+
struct Color
6+
{
7+
Color(uint8_t red, uint8_t green, uint8_t blue) : r(red), g(green), b(blue)
8+
{
9+
}
10+
11+
const uint8_t r;
12+
const uint8_t g;
13+
const uint8_t b;
14+
};
15+
16+
#endif // COLOR_H

lib/ros_lib/march_shared_resources/GaitInstruction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace march_shared_resources
1919
_type_type type;
2020
typedef const char* _gait_name_type;
2121
_gait_name_type gait_name;
22+
enum { UNKNOWN = -1 };
2223
enum { STOP = 0 };
2324
enum { GAIT = 1 };
2425
enum { PAUSE = 2 };
@@ -77,7 +78,7 @@ namespace march_shared_resources
7778
}
7879

7980
const char * getType(){ return "march_shared_resources/GaitInstruction"; };
80-
const char * getMD5(){ return "f655c02301e6cc940112aec0256d56ae"; };
81+
const char * getMD5(){ return "c548bd1201c18293dcff8514a06fc253"; };
8182

8283
};
8384

lib/ros_lib/march_shared_resources/GaitNameAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace march_shared_resources
4848
}
4949

5050
const char * getType(){ return "march_shared_resources/GaitNameAction"; };
51-
const char * getMD5(){ return "17daf8d4908f7456b080321810756286"; };
51+
const char * getMD5(){ return "3d9dbfcd7eb406596122704f6e675e77"; };
5252

5353
};
5454

lib/ros_lib/march_shared_resources/GaitNameActionGoal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace march_shared_resources
4848
}
4949

5050
const char * getType(){ return "march_shared_resources/GaitNameActionGoal"; };
51-
const char * getMD5(){ return "0608001a75969b5f789ca36c4a8c7c0c"; };
51+
const char * getMD5(){ return "c3fcbf5324c7c2a9996a8ed899520f78"; };
5252

5353
};
5454

lib/ros_lib/march_shared_resources/GaitNameGoal.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ namespace march_shared_resources
1414
public:
1515
typedef const char* _name_type;
1616
_name_type name;
17+
typedef const char* _old_name_type;
18+
_old_name_type old_name;
1719
typedef const char* _subgait_name_type;
1820
_subgait_name_type subgait_name;
1921

2022
GaitNameGoal():
2123
name(""),
24+
old_name(""),
2225
subgait_name("")
2326
{
2427
}
@@ -31,6 +34,11 @@ namespace march_shared_resources
3134
offset += 4;
3235
memcpy(outbuffer + offset, this->name, length_name);
3336
offset += length_name;
37+
uint32_t length_old_name = strlen(this->old_name);
38+
varToArr(outbuffer + offset, length_old_name);
39+
offset += 4;
40+
memcpy(outbuffer + offset, this->old_name, length_old_name);
41+
offset += length_old_name;
3442
uint32_t length_subgait_name = strlen(this->subgait_name);
3543
varToArr(outbuffer + offset, length_subgait_name);
3644
offset += 4;
@@ -51,6 +59,15 @@ namespace march_shared_resources
5159
inbuffer[offset+length_name-1]=0;
5260
this->name = (char *)(inbuffer + offset-1);
5361
offset += length_name;
62+
uint32_t length_old_name;
63+
arrToVar(length_old_name, (inbuffer + offset));
64+
offset += 4;
65+
for(unsigned int k= offset; k< offset+length_old_name; ++k){
66+
inbuffer[k-1]=inbuffer[k];
67+
}
68+
inbuffer[offset+length_old_name-1]=0;
69+
this->old_name = (char *)(inbuffer + offset-1);
70+
offset += length_old_name;
5471
uint32_t length_subgait_name;
5572
arrToVar(length_subgait_name, (inbuffer + offset));
5673
offset += 4;
@@ -64,7 +81,7 @@ namespace march_shared_resources
6481
}
6582

6683
const char * getType(){ return "march_shared_resources/GaitNameGoal"; };
67-
const char * getMD5(){ return "e4f9d9eca41dac8a80cbbd410479e54f"; };
84+
const char * getMD5(){ return "80ea09d68b3242bfdc28492fd72d785d"; };
6885

6986
};
7087

0 commit comments

Comments
 (0)