Changes for page ROS Crash Course
Last modified by Leon Poon on 2021/08/30 23:24
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,5 +1,4 @@ 1 -(% class="wikigeneratedid" id="HC2B2BCrashCrashCourse" %) 2 -Using C++. 1 += C++ Crash Crash Course = 3 3 4 4 == Day 1 == 5 5 ... ... @@ -7,15 +7,15 @@ 7 7 8 8 g++ source1.cpp -o program1 9 9 10 -Paths, "/" and "."and".."in navigating directories- absolute vs relative9 +Paths, . and .. in navigating directories 11 11 12 -data type - binary itself ismeaningless unless you saywhat data thebinaryrepresent11 +data type - memory, binary 13 13 14 14 declare variables (int, char, string as series of chars) 15 15 16 16 statements end with semicolon 17 17 18 -cstdio library #include17 +cstdio library include 19 19 20 20 calling a function - printf 21 21 ... ... @@ -33,9 +33,9 @@ 33 33 34 34 While loop = for loop with empty initialiser/advancement statements 35 35 36 -Switch - match expression's result to case label , execute statements until break.35 +Switch - match expression's result to case label 37 37 38 -Switch vs if-else differences - number of times expressions are evaluated37 +Switch vs if-else differences. 39 39 40 40 your own function 41 41 ... ... @@ -55,8 +55,6 @@ 55 55 56 56 Homework: implement factorial (1 to 20) calculator 57 57 58 -in Linux, most things are case-sensitive. (A not equals a) 59 - 60 60 == Day 3 == 61 61 62 62 factorial printer - 2 approaches: ... ... @@ -66,34 +66,7 @@ 66 66 67 67 set initial values of vars when declaring otherwise initial values are unpredictable 68 68 69 -factorial function - implemented in recursive way, closer to mathematical definition 70 70 71 -stack memory 72 72 73 -stack frame to store var values in each function call 74 74 75 -stack overflow/crash (segfault) 76 - 77 -base condition to stop the recursion 78 - 79 -recursive algorithms are common - e.g. when dealing with trees 80 - 81 -spaces in file/directory names and how to navigate - space is special in terminal 82 - 83 -understand names chosen by yourself vs names chosen by other people for your use 84 - 85 -creating ros package - arguments: package name, dependencies 86 - 87 -CMakeLists.txt (.txt file can also be used with other programs) 88 - 89 -cmake = build tool - compile many files in some defined ways 90 - 91 -package.xml - information for ROS 92 - 93 -compiling - carefully read and understand and seek answers to error messages 94 - 95 -msg files - fields declaration with data type 96 - 97 -cpp file for a node 98 - 99 -homework: implement message subscriber node according to ROS book 69 +