-
Notifications
You must be signed in to change notification settings - Fork 0
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
Start of ImGUI UI #6
base: main
Are you sure you want to change the base?
Conversation
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 compiled this locally and it looks good, I really like the way it was done!
Overall, as I suggested to you a few times initially, I would ensure that you know where we already stand with our existing code in order to not reimplement features. I was worried this would happen which is why I tried to give you a run-down of what we have. If you are unsure about our existing structure and/or what we have done so far, feel free to look at previous commits/pull-requests or let me know.
Also, it would be nice to make the frontend ROV-agnostic as I discussed. I plan to do soon with our web frontend. However this is definitely something we can discuss.
I will end my review by requesting some changes. All in all I don't think they will take a long time to implement and I can definitely help with a lot of it. If you have questions please let me know!
if (ImGui::BeginMenu("Load Config")) { | ||
for (const auto& configFile : recursive_directory_iterator("configs")) { | ||
if (ImGui::MenuItem(configFile.path().filename().string().c_str())) { | ||
ifstream configJson(string("configs/") + configFile.path().filename().string()); | ||
json configData = json::parse(configJson); | ||
std::strncpy(config.cam1ip, configData["cameraIPs"][0].get<std::string>().c_str(), sizeof(config.cam1ip)); | ||
std::strncpy(config.cam2ip, configData["cameraIPs"][1].get<std::string>().c_str(), sizeof(config.cam2ip)); | ||
std::strncpy(config.cam3ip, configData["cameraIPs"][2].get<std::string>().c_str(), sizeof(config.cam3ip)); | ||
std::vector<int> buttons = configData["buttons"].get<std::vector<int>>(); | ||
config.buttonActions.clear(); | ||
for (int i = 0; i < buttons.size(); i++) { | ||
config.buttonActions.push_back(static_cast<ButtonAction>(buttons[i])); | ||
} | ||
std::vector<int> axes = configData["axes"].get<std::vector<int>>(); | ||
config.axisActions.clear(); | ||
for (int i = 0; i < axes.size(); i++) { | ||
config.axisActions.push_back(static_cast<AxisAction>(axes[i])); | ||
} | ||
} | ||
} | ||
ImGui::EndMenu(); |
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.
Please integrate this with existing functionality (see CameraStreamUrls
function in ROS2/ROS_workspace/src/cli_app/src/cli.cpp
, which is already integrated with profiles_manager.py
).
This is not to say that you should keep the CameraStreamUrls
function as-is, in fact it should be probably split into two separate functions where one handles communication with profiles_manager.py
and the other is for the cli aspect. However, it's not standard to completely rewrite existing functionality.
Changes the format of the profiles and stores them in a JSON file
corrected with comments
added comments and cleaned code
No description provided.