Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

Commit 3489516

Browse files
committed
Move NET workspace page and rebased to get linting updates
1 parent f4b01ee commit 3489516

File tree

3 files changed

+23
-98
lines changed

3 files changed

+23
-98
lines changed

docs/reference/cpp/net_workspace.md renamed to docs/current/sailbot_workspace/net_workspace.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ The Network Systems directory is similar to the following (READMEs and CMakeList
77
```
88
network_systems
99
| package.xml
10+
|
11+
└───.github
12+
| | ...
13+
|
14+
└───launch
15+
| | ...
16+
|
1017
└───lib
1118
| └───protofiles
1219
| | message.proto
@@ -34,6 +41,10 @@ network_systems
3441
At the root of the directory is a `package.xml`. This file tells ROS2 that the network_systems package exists. It is
3542
what allows us to run, for example: `ros2 run network_systems example`.
3643

44+
`.github/` contains Github specific files like workflows for continuous integration.
45+
46+
`launch/` contains ROS launch files.
47+
3748
## lib
3849

3950
The lib is where we will place static libraries that we want to be accessible to all programs. This means they do not
@@ -55,7 +66,7 @@ To add a new module, create a folder and add it to `projects/CMakeLists.txt`. In
5566
(optional), `src/`, and `test/` folder, as well as a `CMakeLists.txt` which will need to be filled out accordingly.
5667

5768
??? example
58-
This is the `CMakeLists.txt` for an example module where the source files are for Cached Fibonacci program.
69+
This is the `CMakeLists.txt` for an example module where the source files are for a Cached Fibonacci program.
5970

6071
```cmake
6172
set(module example)

docs/reference/cpp/tools.md

Lines changed: 10 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -14,94 +14,6 @@ CMake is a powerfull build automation tool that makes compiling code for large p
1414
files a lot easier. Steps 1-3 of the [official tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html){target=_blank}
1515
are great for understanding the basics.
1616

17-
## GDB
18-
19-
The [GNU Project Debugger](https://www.sourceware.org/gdb/){target=_blank} is the most commonly debugger for the C
20-
language family.
21-
VSCode also has a degree of integration with GDB that allows an easy to use GUI. This [GDB cheat sheet](https://darkdust.net/files/GDB%20Cheat%20Sheet.pdf){target=_blank}
22-
has all the GDB comands you will need to know. Be aware the VSCode has GUI buttons for some of these commands that are
23-
easier to use.
24-
25-
<!-- TODO Add examples with screenshots -->
26-
27-
## GoogleTest
28-
29-
[GoogleTest](https://github.com/google/googletest){target=_blank} is the C++ unit testing framework we will be using.
30-
The [GoogleTest Primer](https://google.github.io/googletest/primer.html){target=_blank} is a good place to start.
31-
32-
??? example
33-
34-
=== "Cached Fibonacci Program"
35-
36-
```C++ title="cached_fib.h"
37-
#include <vector>
38-
class CachedFib {
39-
public:
40-
void CachedFib(int n);
41-
int getFib(int n);
42-
private:
43-
std::vector<int> cache;
44-
}
45-
```
46-
47-
```C++ title="cached_fib.cpp"
48-
#include <iostream>
49-
#include <vector>
50-
#include "cached_fib.h"
51-
52-
void CachedFib::CachedFib(int n) {
53-
cache.push_back(0);
54-
cache.push_back(1);
55-
for (int i = 2; i < n; i++) {
56-
cache.push_back(cache[i - 1] + cache[i - 2]);
57-
}
58-
}
59-
60-
int CachedFib::getFib(int n) {
61-
if (cache.size() < n) {
62-
for (int i = cache.size(); i < n; i++) {
63-
cache.push_back(cache[i-1] + cache[i-2]);
64-
}
65-
}
66-
std::cout << cache[n - 1] << std::endl;
67-
}
68-
```
69-
70-
=== "Test Cached Fibonacci Program"
71-
72-
```C++ title="test_cached_fib.cpp"
73-
74-
#include "cached_fib.h"
75-
#include "gtest/gtest.h"
76-
77-
CachedFib::testFib;
78-
79-
class TestFib : public ::testing::Test {
80-
protected:
81-
void Setup override {
82-
// Every time a test is started, testFib is reinitialized with a constructor parameter of 5
83-
testFib = CachedFib(5);
84-
}
85-
}
86-
87-
TEST_F(TestFib, TestBasic) {
88-
ASSERT_EQ(getFib(5), 3) << "5th fibonacci number must be 3!";
89-
}
90-
91-
// more tests
92-
93-
```
94-
95-
<!-- ## Google Mock Not sure if we're going to use this yet -->
96-
97-
## Google Protocol Buffer
98-
99-
[Google Protocol Buffer](https://developers.google.com/protocol-buffers){target=_blank} (Protobuf) is a portable data serialization
100-
method. We use it over other methods like JSON and XML because it produces smaller binaries, an important consideration
101-
when sending data across an ocean. Unfortunately, there does not seem to be a easy to follow tutorial for using them,
102-
but here are the [C++ basics](https://developers.google.com/protocol-buffers/docs/cpptutorial){target=_blank}. The page
103-
is quite dense and can be hard to follow, so do not worry if you do not understand it.
104-
10517
## Clang
10618

10719
In its most basic form, [Clang](https://clang.llvm.org/){target=_blank} is a compiler for the C language family.
@@ -127,17 +39,18 @@ as you hit save.
12739

12840
## GDB
12941

130-
The [GNU Project Debugger](https://www.sourceware.org/gdb/) is the most commonly debugger for the C language family.
131-
VSCode also has a degree of integration with GDB that allows an easy to use GUI. This [GDB cheat sheet](https://darkdust.net/files/GDB%20Cheat%20Sheet.pdf)
42+
The [GNU Project Debugger](https://www.sourceware.org/gdb/){target=_blank} is the most common debugger for the C
43+
language family.
44+
VSCode also has a degree of integration with GDB that allows an easy to use GUI. This [GDB cheat sheet](https://darkdust.net/files/GDB%20Cheat%20Sheet.pdf){target=_blank}
13245
has all the GDB comands you will need to know. Be aware the VSCode has GUI buttons for some of these commands that are
13346
easier to use.
13447

13548
<!-- TODO Add examples with screenshots -->
13649

13750
## GoogleTest
13851

139-
[GoogleTest](https://github.com/google/googletest) is the C++ unit testing framework we will be using.
140-
The [GoogleTest Primer](https://google.github.io/googletest/primer.html) is a good place to start.
52+
[GoogleTest](https://github.com/google/googletest){target=_blank} is the C++ unit testing framework we will be using.
53+
The [GoogleTest Primer](https://google.github.io/googletest/primer.html){target=_blank} is a good place to start.
14154

14255
??? example
14356

@@ -218,16 +131,17 @@ The [GoogleTest Primer](https://google.github.io/googletest/primer.html) is a go
218131
TEST_F(TestFib, TestBasic) { ASSERT_EQ(testFib.getFib(5), 3) << "5th fibonacci number must be 3!"; }
219132

220133
// more tests
221-
222134
```
223135

136+
<!-- ## Google Mock Not sure if we're going to use this yet -->
137+
224138
## Google Protocol Buffer
225139

226-
[Google Protocol Buffer](https://developers.google.com/protocol-buffers) (Protobuf) is a portable data serialization
140+
[Google Protocol Buffer](https://developers.google.com/protocol-buffers){target=_blank} (Protobuf) is a portable data serialization
227141
method. We use it over other methods like JSON and XML because it produces smaller binaries, an important consideration
228142
when sending data across an ocean. Unfortunately, there does not seem to be a easy to follow tutorial for using them,
229-
but here are the [C++ basics](https://developers.google.com/protocol-buffers/docs/cpptutorial). The page is quite dense
230-
and can be hard to follow, so do not worry if you do not understand it.
143+
but here are the [C++ basics](https://developers.google.com/protocol-buffers/docs/cpptutorial){target=_blank}. The page
144+
is quite dense and can be hard to follow, so do not worry if you do not understand it.
231145

232146
## llvm-cov
233147

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ nav:
103103
- Overview: current/sailbot_workspace/overview.md
104104
- Setup: current/sailbot_workspace/setup.md
105105
- Run: current/sailbot_workspace/run.md
106+
- NET Workspace Structure: current/sailbot_workspace/net_workspace.md
106107
- Reference:
107108
- reference/index.md
108109
- C++:
109110
- Getting Started:
110111
- reference/cpp/index.md
111112
- Differences: reference/cpp/differences.md
112113
- Tools: reference/cpp/tools.md
113-
- NET Workspace Structure: reference/cpp/net_workspace.md
114114
- GitHub:
115115
- Development Workflow:
116116
- Overview:

0 commit comments

Comments
 (0)