scripts: Fix port aliasing bug in blackboard entry loading#44
Merged
Conversation
3 tasks
5b596eb to
178fc41
Compare
Add .envrc file to automatically enable nix exposing correct tools including the code formating software. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Remove all un-referenced default variables to save memory. In addition, print the variable name in the C vector code. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Add a sample that validates multiple instances of the same node type with different port bindings get distinct blackboard references. This serves as a regression test for the port aliasing bug fixed in issue #40. Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
The loadBlackboardEntries function returned references to shared entry objects from blackboard_set. When multiple instances of the same node type had different port bindings, each instance overwrote entry[4], causing all instances to end up with the same blackboard ref. Use copy.deepcopy(entry) to ensure each node instance gets its own copy of the blackboard entry, so port bindings are resolved correctly. Fixes #40 Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
178fc41 to
298c358
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loadBlackboardEntriesto usecopy.deepcopy(entry)instead of appending shared references, preventing all instances of the same node type from getting the same blackboard ref when they have different port bindingsport_aliassample exercising the fix withWriteValue/ReadValuenodes bound to distinct blackboard variables ({variable_a}and{variable_b})Fixes #40
Test plan
port_aliassample XML and verify distinct.refvalues in the generated_data.cport_aliassample onqemu_cortex_m3— confirmwrite_valueandread_valuenodes access their own blackboard variablesdynamic,subtree_reuse,tutorial) still generate correctlySupersides #42