-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon_issues.txt
56 lines (39 loc) · 3.18 KB
/
common_issues.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Error:
Linking project with okapilib,libpros [ERRORS]
./bin/utils/robot/drive/mech_drive.cpp.o:(.rodata._ZTI10Mech_Drive+0x8): undefined reference to `typeinfo for Drive'
./bin/utils/robot/robot_factory.cpp.o: In function `RobotFactory::create_robot(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
robot_factory.cpp:(.text._ZN12RobotFactory12create_robotENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_S5_+0x154): undefined reference to `typeinfo for Drive'
collect2.exe: error: ld returned 1 exit status
make: *** [common.mk:191: bin/monolith.elf] Error 1
Error: Failed to build
Fix: Make sure all virtual functions are = 0, I.E.
virtual void Set_Drive(double left_x, double left_y, double right_x, double right_y) = 0;
Error:
FETCH ERROR [LCD Error]
Fix: Lambda Functions: I.E.
[&](void) -> bool { if(this->isSync){ pros::lcd::set_text(6, "yee" + to_string(this->isSync));}return _time >= duration; }, init, kill}
Error:
MEMORY PERMISSION ERROR
Cause 1 : Accessing variables that have been declared in initialize.hpp but not initialized, so when
you say ```int a;``` in h file, don't give it a value and reference it.
Cause 2 : Using objects that were not created with the ```new``` keyword does this too, I'm not 100% sure why, but
objects that don't use the ```new``` keyword are completely wack, they're methods might not give you errors in compile,
and it will let you create them, but they're instance variables will have really wierd values, like _time in autotimer
was always 70000000, even when it was declared as 0 or 1, and sometimes it will just not let you have class variables like
I tried to define a ```int test = 4;``` and it gave me memory permission for that, it's really weird.
Error: Values that are randomly 77594888 or w/e even when declared as like 1
Cause: Using local variables in & capture - for some reason in an object constructor references to this->whatever will work but not
if you have a variable x defined locally in the context, for ints it will just convert to like 7 mil.
**Don't use ```using namespace std;``` in .h or .hpp files will break on build something about Okapi def or w/e***
Error: Memory Permission -
Cause: Don't assign motors and shit inside constructor of modules - ALWAYS USE Create() method to assign motors because otherwise
you will assign an extern motor that hasn't been initialized in initialized.cpp yet
**** UPGRADING PROS ****
ok so there are 3 different things in pros - the terminal CLI, the editor, and the actual KERNEL itself.
The CLI is just the set of commands that are availible to you to use, the KERNEL is what is
responsible for the machinery behind the scenes and compiling - when a new sensor comes out,
the CLI may stay on the same version, but the KERNEL is what will upgrade to support it.
`prosv5 upgrade` upgrades specifically the terminal CLI but not the kernel.
To upgrade KERNEL, run `prosv5 conduct upgrade` -> `prosv5 conduct info` gives you
the current version number. `prosv5 conduct` is generally the useful command for
managing pros.