-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add Plugin XML Attributes to Mission XML Log #568
base: master
Are you sure you want to change the base?
Changes from 39 commits
58c3fed
84bd801
68dc6c3
21c7b98
c95c68a
45508c5
75a9aa9
812b327
cc27377
afd20a8
ad6b58f
a9fb57d
2d04f5a
36187fa
87f2ed7
811875e
2f9d201
b2936d3
a5d6fce
4fce2a7
b8eaacb
1e0fa94
794e018
7902c32
b119eab
7e6d3cb
d47c78d
1b53c6f
683ef14
d09062e
495c54a
50e6269
300567f
5115e3b
44a8fd7
5ae9f77
35035ae
d54a383
f5dfa48
09bde10
4271d6a
318b405
050e2d5
bd6a242
ebf9605
2ddb14b
c025b7c
c0267fa
064bcd5
fd5c886
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this file after writing the tutorial files |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this file after writing the tutorial files |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this commit later - accidentally added. Used only for testing. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -726,8 +726,59 @@ void Entity::print_plugins(std::ostream &out) const { | |
out << c->name() << endl; | ||
} | ||
out << "----------- Motion -------------" << endl; | ||
if (motion_model_->name() != "BLANK") { | ||
if (motion_model_ && motion_model_->name() != "BLANK") { | ||
out << motion_model_->name() << endl; | ||
} | ||
} | ||
} // namespace scrimmage | ||
|
||
// Note: All data passed from the mission_xml_get function must be formatted as a map of strings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this when finished |
||
// to strings. This will assist with the Rapid XML formatting. Additionally, the first entry of the map | ||
// must be the name of the given plugin - for example: "Straight" for an autonomy plugin. The key for the | ||
// plugin name must be "Name". | ||
|
||
std::map<std::string,std::string> Entity::set_motion_xml_map(){ | ||
std::map<std::string,std::string> cur_motion_xml; | ||
if (motion_model_ && motion_model_->name() != "BLANK") { | ||
cur_motion_xml = motion_model_->mission_xml_get(); | ||
} | ||
|
||
return cur_motion_xml; | ||
} | ||
|
||
std::vector<std::map<std::string,std::string>> Entity::set_sensor_xml_vect(){ | ||
std::vector<std::map<std::string,std::string>> all_sensor_xml; | ||
std::map<std::string,std::string> cur_sensor_xml; | ||
|
||
for (auto &kv : sensors_) { | ||
cur_sensor_xml = kv.second->mission_xml_get(); | ||
all_sensor_xml.push_back(cur_sensor_xml); | ||
} | ||
|
||
return all_sensor_xml; | ||
} | ||
|
||
std::vector<std::map<std::string,std::string>> Entity::set_autonomy_xml_vect(){ | ||
std::vector<std::map<std::string,std::string>> all_autonomy_xml; | ||
std::map<std::string,std::string> cur_autonomy_xml; | ||
|
||
for (AutonomyPtr a : autonomies_) { | ||
cur_autonomy_xml = a->mission_xml_get(); | ||
all_autonomy_xml.push_back(cur_autonomy_xml); | ||
} | ||
|
||
return all_autonomy_xml; | ||
} | ||
|
||
std::vector<std::map<std::string,std::string>> Entity::set_controller_xml_vect(){ | ||
std::vector<std::map<std::string,std::string>> all_controller_xml; | ||
std::map<std::string,std::string> cur_controller_xml; | ||
|
||
for (ControllerPtr c : controllers_) { | ||
cur_controller_xml = c->mission_xml_get(); | ||
all_controller_xml.push_back(cur_controller_xml); | ||
} | ||
|
||
return all_controller_xml; | ||
} | ||
|
||
} // namespace scrimmage |
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.
Remove this file after writing the tutorial files