-
Notifications
You must be signed in to change notification settings - Fork 97
Add Plugin XML Attributes to Mission XML Log #568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
laserjetprinter
wants to merge
50
commits into
master
Choose a base branch
from
plugintomissionxml
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
58c3fed
Initial commit
84bd801
Working verison, adds attribute and value and then prints the doc upd…
68dc6c3
Working for all plugins
21c7b98
Created function to parse the plugin specific xml file. This is worki…
c95c68a
Code cleanup
45508c5
Removed mission file change
75a9aa9
minor error message changes, added extra digit to time UI
812b327
Merge branch 'william-qol' of https://github.com/gtri/scrimmage into …
cc27377
Added returns in case of error with finding params files
afd20a8
Working with scrimmage_plugin_path environment variable
ad6b58f
Mission.plugin.xml log file added
a9fb57d
Code cleanup
2d04f5a
Initial commit of mission to mission xml pull request. Currently, abl…
36187fa
Struct is working between mission parse and sim control files. Can re…
87f2ed7
Working for updating x, y, and z pos of new entities
811875e
Removes original entity blocks
2f9d201
Additional checks/removals
b2936d3
Added tag to determine if mission 2 mission output file should be cre…
a5d6fce
Remove block tag working for original entities being added/removed fr…
4fce2a7
New final entity state file is created to view the final states of ea…
b8eaacb
Code cleanup
1e0fa94
Code cleanup
794e018
Working before trying to put struct with fwd decl file
7902c32
Struct in header is now working... do not need fwd decl or the new he…
b119eab
Delete EntEndStates.h
laserjetprinter 7e6d3cb
Cleanup and support for struct in simcontrol header
d47c78d
Merge branch 'plugintomissionxml' of https://github.com/gtri/scrimmag…
1b53c6f
Updating header comments
683ef14
Test commit
d09062e
Code clean up
495c54a
Fixing a seg fault case based on mission xml tags
50e6269
Working on getting the plugin specific xml tag values. Currently am a…
300567f
Function working to get the xml tag values from the autonomy plugin
5115e3b
Rapid xml is working, writing plugin specific tags to the motion mode…
44a8fd7
Fully working for plugin specific xml tags populating the mission to …
5ae9f77
Fixed so that the plugin xml tags that are from the function overwrit…
35035ae
Fixed remove block tag logic
d54a383
Code cleanup and adding briefs
f5dfa48
Changing var names of miss2miss
09bde10
Added brief to Mission Parse header
4271d6a
RST file
318b405
Forgot to add the mission-to-mission-xml rst file
050e2d5
Minor updates
bd6a242
Merge branch 'master' of https://github.com/gtri/scrimmage into plugi…
ebf9605
Removing files that were used only for demoing
2ddb14b
Reverting William's changes to see if Docker builds
c025b7c
Fixed issue where docker was seg faulting for the test_openai.py file
c0267fa
Adding williams changes back
064bcd5
Merge branch 'master' of https://github.com/gtri/scrimmage into plugi…
fd5c886
Fixed the team id check and wording in the tutorial file
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| ================================== | ||
| Mission to Mission XML Generation | ||
| ================================== | ||
|
|
||
| This tutorial covers the process of capturing the end states of entities in | ||
| an XML file, which can be used as starting points for future simulations. The | ||
| following must be completed before the mission to mission capabilities can be | ||
| utilized: | ||
|
|
||
| 1. In the mission XML file, the following tag must be included with the value ``true``:: | ||
|
|
||
| <mission_to_mission>true</mission_to_mission> | ||
|
|
||
| 2. In the mission XML file's entity block, if the block should be included in the output | ||
| mission XML file - meaning future simulations will require the block, the following tag | ||
| must be included with the value ``true``. If it is not included, the entity block will be removed | ||
| from the output mission XML file. :: | ||
|
|
||
| <remove_block>true</remove_block> | ||
|
|
||
| 3. If plugin specific XML tag attributes (applicable to motion, sensor, autonomy, and controller plugins) | ||
| are expected to be updated while the simulation is running, the following function declaration will need to | ||
| be added to the plugin's header file:: | ||
|
|
||
| std::map<std::string,std::string> mission_xml_get() override; | ||
|
|
||
| The mission_xml_get function must insert plugin specific xml tags as strings to a map. Depending on the variable | ||
| type of the xml tag, extra formatting might be needed - for example: converting a bool to a string results in | ||
| "0" or "1," which will need to be converted to "true" or "false." | ||
|
|
||
| Here is an example of the mission_xml_get, implemented in the SimpleAircraft.cpp file:: | ||
|
|
||
| std::map<std::string,std::string> SimpleAircraft::mission_xml_get() { | ||
| std::map<std::string,std::string> mission_xml; | ||
|
|
||
| mission_xml.insert({"Name","SimpleAircraft"}); | ||
| mission_xml.insert({"min_velocity",std::to_string(min_velocity_)}); | ||
| mission_xml.insert({"max_velocity",std::to_string(max_velocity_)}); | ||
| mission_xml.insert({"max_roll",std::to_string(max_roll_)}); | ||
| mission_xml.insert({"max_roll_rate",std::to_string(max_roll_rate_)}); | ||
| mission_xml.insert({"max_pitch",std::to_string(max_pitch_)}); | ||
| mission_xml.insert({"max_pitch_rate",std::to_string(max_pitch_rate_)}); | ||
| mission_xml.insert({"speed_target",std::to_string(speedTarget_)}); | ||
| mission_xml.insert({"radius_slope_per_speed",std::to_string(lengthSlopePerSpeed_)}); | ||
| mission_xml.insert({"turning_radius",std::to_string(length_)}); | ||
|
|
||
| return mission_xml; | ||
| } | ||
|
|
||
| Note that the plugin name must be specified as the first entry in the map, with the key ``Name`` and the | ||
| value ``<plugin_name>``. In the map, each xml specific tag attribute name must be the key of the map and | ||
| the attribute value must be the value of the map. | ||
|
|
||
| There will be 2 output files, which can be found in the simulation's log directory: | ||
| ``~/.scrimmage/logs/<scrimmage_run_log_directory>``. | ||
|
|
||
| 1. The ``mission_to_mission.xml`` file captures the final entity states and formats the data to be used as an | ||
| input file to future SCRIMMAGE simulations. | ||
|
|
||
| 2. The ``final_ent_states.txt`` file captures the final state information for each entity. These values can be | ||
| used as reference to verify end states and capture values like velocity, which do not have entity specific tags. | ||
| The following entity end states are included in the output text file: | ||
|
|
||
| * Team_ID | ||
| * X_Pos | ||
| * Y_Pos | ||
| * Z_Pos | ||
| * Vel_X | ||
| * Vel_Y | ||
| * Vel_Z | ||
| * Heading | ||
| * Pitch | ||
| * Roll | ||
| * Altitude | ||
| * Health | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,3 +34,4 @@ swarm behaviors. | |
| utilities.rst | ||
| simcontrol.rst | ||
| capture-the-flag.rst | ||
| mission-to-mission-xml.rst | ||
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should say false