Skip to content
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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Start of ImGUI UI #6

wants to merge 31 commits into from

Conversation

evaan
Copy link
Member

@evaan evaan commented Dec 21, 2024

No description provided.

Copy link
Contributor

@Zaid-Duraid Zaid-Duraid left a 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!

.gitmodules Outdated Show resolved Hide resolved
WaterwitchGUI/src/Config.hpp Show resolved Hide resolved
WaterwitchGUI/src/Config.hpp Outdated Show resolved Hide resolved
WaterwitchGUI/src/Power.hpp Outdated Show resolved Hide resolved
WaterwitchGUI/src/main.cpp Show resolved Hide resolved
WaterwitchGUI/src/main.cpp Show resolved Hide resolved
WaterwitchGUI/src/Config.hpp Show resolved Hide resolved
Comment on lines +70 to +90
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();
Copy link
Contributor

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.

WaterwitchGUI/src/main.cpp Outdated Show resolved Hide resolved
WaterwitchGUI/src/stb_image.h Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants