BurtSharp merge requestshttps://git.barrett.com/burt/software/burt-sharp/-/merge_requests2024-03-28T16:38:39-04:00https://git.barrett.com/burt/software/burt-sharp/-/merge_requests/396Console Manager Updates2024-03-28T16:38:39-04:00Craig McDonaldConsole Manager Updates### Description
Changes to the KeyboardManager and ConsoleManager are pretty huge. I moved them both inside the namespace BurtSharp.Util like they were supposed to be (SystemLogger is the only exception since it's so ubiquitous.)
Asid...### Description
Changes to the KeyboardManager and ConsoleManager are pretty huge. I moved them both inside the namespace BurtSharp.Util like they were supposed to be (SystemLogger is the only exception since it's so ubiquitous.)
Aside from a few name changes, the KeyboardManager hasn't really been changed, just augmented. I added the KeyPressCallback class, which uses a bunch of factory methods as constructors, to make it easier for the ConsoleManager to use the AddKeyPressCallback method. The variables named KeyPressDelegate1...KeyPressDelegate4 were not very descriptive, so I gave them names to tell what type of argument they accept, e.g. KeyPressDelegateStr.
The ConsoleManager has been completely overhauled, so you might as well look at it as a new file instead of looking at the diff. It now uses the singleton pattern like the SystemLogger. It breaks up the console into three sections: usage instructions, variable display, and log display. The usage instructions get created automatically from the different overloads of AddKeyPressCallback(), and those instructions always remain at the top of the window. The middle section takes up as much space as is needed for printing variables that will be updated every control loop. The remaining space at the bottom of the window shows the SystemLogger messages as well as messages written through the new method ConsoleManager.WriteLine(). My intent is for any program that uses the ConsoleManager to call ConsoleManager.WriteLine() in place of the standard Console.WriteLine() provided by the System library. Finally, using the up/down arrow keys or the PageUp PageDown keys you can scroll through the log display on the window.
The SystemLogger I mostly just rearranged and added comments. Most importantly, I removed the use of the UnityEngine's logging function and replaced it with a delegate that will be set in BurtSharpUnity. That way BurtSharp doesn't need the UnityEngine as a dependency. Since almost every project uses the SystemLogger, they *did* have UnityEngine as a reference. That's why it has been removed from the csproj files of most projects and the BurtSharp library as a whole.
Added a version of the CircularBuffer for storing strings, which is what manages the logger display on the console. While updating CircularBuffer I made some name changes (GetLast is now GetOldest) and added a few features to help support the console manager.
### What to focus on
- Program designed to test the new ConsoleManager in Sandbox is called ConsoleTest. It allows you to toggle whether or not there is a log display, AND whether or not the messages from the SystemLogger are being grabbed and rerouted to the window.
- Programs that use the new ConsoleManager and should be tested: Example04-DisplayBasicInfo, DisturbanceObserverTest, MovementAnalysisTest, RobotAccelerationEstimatorTest
- Test with burt/software/burt-sharp-unity!139 in a game to ensure that system logger output still goes to Unity Debug log when playing in the Unity editor
### Issues
> What issues does this fix?
- Fixes #253Emily AustinEmily Austinhttps://git.barrett.com/burt/software/burt-sharp/-/merge_requests/390Keyboard Manager Updates2024-03-28T16:12:36-04:00Craig McDonaldKeyboard Manager Updates### Description
Refactored the keyboard manager to be able to handle a wider variety of keypress callbacks (like arrow keys, or enter key) with more specificity (lower-case vs upper-case, etc). Can also handle groups of keys like numeri...### Description
Refactored the keyboard manager to be able to handle a wider variety of keypress callbacks (like arrow keys, or enter key) with more specificity (lower-case vs upper-case, etc). Can also handle groups of keys like numeric for when we want them all tied to one callback.
### What to focus on
- Changes to KeyboardManager.cs and trying it out in the Sandbox/KeyboardTest, which is designed to test each of the overloaded AddKeyPressCallback methods.
- Each of the BurtSharp programs that was changed should be run and interacted with just to make sure they are all working properly.Emily AustinEmily Austinhttps://git.barrett.com/burt/software/burt-sharp/-/merge_requests/364Haptics and Geometry Part 42024-03-19T14:58:28-04:00Craig McDonaldHaptics and Geometry Part 4### Description
This is the final component needed to render haptic objects in LaundryLoader. Used HapticExtrusion to add extruded holes to the walls of the HapticBox.
Added 3 new scenes in HapticGeometryTest to test it in various ways...### Description
This is the final component needed to render haptic objects in LaundryLoader. Used HapticExtrusion to add extruded holes to the walls of the HapticBox.
Added 3 new scenes in HapticGeometryTest to test it in various ways. The final two are a "washing machine" and a "laundry basket" to test the key things needed for those objects in LaundryLoader.
Added the GameHapticsTest sandbox program in order to test the effect of the workspace transform used by the Unity games, which can scale the X, Y, and Z axes arbitrarily. This is mainly for debugging purposes.
### What to focus on
- Changes to HapticBox so it can render holes.
- Testing the new HapticBox examples in HapticGeometryTest.Thomas NadovichThomas Nadovichhttps://git.barrett.com/burt/software/burt-sharp/-/merge_requests/363Geometry and Haptics Part 32024-03-19T14:58:20-04:00Craig McDonaldGeometry and Haptics Part 3### Description
Added the 3D geometry of extruded surfaces, which are made by extruding a 2D cross section along a Line.
Using the C# concept of an interface to implement the cross section. Not strictly necessary, since the only thing ...### Description
Added the 3D geometry of extruded surfaces, which are made by extruding a 2D cross section along a Line.
Using the C# concept of an interface to implement the cross section. Not strictly necessary, since the only thing that implements ICrossSection is Geometry2D right now, but we could have other implementations in the future. I was mainly just trying something out, and I like how flexible (figuratively) it can be.
### What to focus on
- Extrusion, the only other 3D geometry object besides RectangularPrism
- HapticExtrusion, based on the Extrusion
- Testing the HapticExtrusion in HapticGeometryTest
- Added a "Cylinder" to HapticObjectTest, but it needs some additional work. Should be functional.Thomas NadovichThomas Nadovichhttps://git.barrett.com/burt/software/burt-sharp/-/merge_requests/362Geometry and Haptics Part 22024-03-19T14:58:11-04:00Craig McDonaldGeometry and Haptics Part 2### Description
This merge request focuses on the HapticBox, which is our first 3D solid object. In order to have sharp corners how we are used to feeling them, its implementation is a little unusual. It uses the RectangularPrism geomet...### Description
This merge request focuses on the HapticBox, which is our first 3D solid object. In order to have sharp corners how we are used to feeling them, its implementation is a little unusual. It uses the RectangularPrism geometry for it's general shape, size, and location, but that's it. The depth calculations and collision detection are handled by six haptic walls, and we very explicitly only render one wall at a time.
Testing and visualization of the geometry algorithms were done in matlab, but unit tests have not yet been implemented.
### What to focus on
- RectangularPrism, the first 3D geometry object
- HapticBox, which uses RectangularPrism and HapticWall
- Testing the HapticBox in HapticGeometryTest with the Cube exampleThomas NadovichThomas Nadovichhttps://git.barrett.com/burt/software/burt-sharp/-/merge_requests/361Geometry and Haptics Part 12024-03-19T14:57:34-04:00Craig McDonaldGeometry and Haptics Part 1### Description
Added new Geometry section of BurtSharp library to manage the geometry of haptic objects as they get increasingly complex. Geometry is a subfolder of Math because these classes are completely separate from haptics, and c...### Description
Added new Geometry section of BurtSharp library to manage the geometry of haptic objects as they get increasingly complex. Geometry is a subfolder of Math because these classes are completely separate from haptics, and could be used for other purposes.
Every public or protected member of a class should have comments for documentation, so as not to generate more compiler warnings. This means that hopefully I do not need to do a lot of additional explanation beyond what's in the comments.
As a note, this online source was used, and cited, for some of the distance algorithms https://www.geometrictools.com/Documentation/Documentation.html.
This merge request mostly only deals with 2D geometry (the Plane and Line are technically in 3D space). The next merge request will add 3D geometry and haptic objects that makes use of it.
### What to focus on
- The new Geometry classes designed to underlie haptic objects.
- HapticWall changes to make use of the new geometry classes.
- HapticGeometryTest program designed to test the features developed in this branch.
- All haptics and control still remains functional.Thomas NadovichThomas Nadovich