-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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 Vehicle option for Subwindow settings #2841
Conversation
Thanks for doing this! Made a comment in the code for a minor change to deal with an edge case I came into. Also, perhaps naming the new field 'VehicleName' would be better to stay consistent with 'CameraName'? |
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.
A couple of extra comments for minor changes and clean up!
subwindow_settings.push_back(SubwindowSetting(0, ImageType::DepthVis, false, "", "")); //depth | ||
subwindow_settings.push_back(SubwindowSetting(0, ImageType::Segmentation, false, "", "")); //seg | ||
subwindow_settings.push_back(SubwindowSetting(0, ImageType::Scene, false, "", "")); //vis |
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.
Today I tried to make an identical change on my fork - had an issue where the default WindowID of zero was overwriting a specified window for some reason? (At least I think that's what was happening). Specifying WindowID as 0, 1 and 2 respectively seemed to fix it
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.
Just reviewing, I believe It's the particular case where you only assign, say, Drone 2 to WindowID 0 and Drone 1 to WindowID 2. The defaults for the '3rd default' end up overwriting Drone 2 on WindowID 0, instead of doing nothing (or perhaps only initialising the windowID1).
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.
Didn't understand this exactly, how to reproduce the problem?
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.
Use the following settings:
"SubWindows": [
{"WindowID": 0, "CameraName": "0", "ImageType": 3, "VehicleName": "Car2", "Visible": true},
{"WindowID": 2, "CameraName": "0", "ImageType": 0, "VehicleName": "Car1", "Visible": true}
],
What you will see is Car 2's view in WindowID 0 being replaced by the default view (I assume Car1).
This is due to all initialised subwindows being initialised with WindowID 0. As only 2 of the default subwindows are overwritten, the third is still 'active'.
Is this explanation any clearer? [Edit made visible true instead of false]
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.
Yup, that makes sense, I'll test it out. The second comment wasn't there when I replied :)
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.
Thanks for the detailed explanation! I've changed the Window IDs to 0,1,2
@@ -323,18 +323,25 @@ void ASimHUD::initializeSubWindows() | |||
} | |||
else | |||
subwindow_cameras_[0] = subwindow_cameras_[1] = subwindow_cameras_[2] = nullptr; | |||
} |
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.
Is this above if statement (lines 313 -326) necessary anymore?
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.
They add default cameras if the lines below fail, so I think they're needed
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.
Ah yes you are right, thats the safest option
07c4d4e
to
9b73040
Compare
Changed to |
9b73040
to
f577457
Compare
/azp run microsoft.AirSim |
Azure Pipelines successfully started running 1 pipeline(s). |
f577457
to
e0cc83f
Compare
Currently, Unity is crashing on startup, when subwindow settings are not there, or even if a Car vehicle is specified due to error in parsing the settings file. Only works if the settings are empty. |
Hmm, is a non-impl in Unity feasible? If so, we should add this feature in Unreal for this PR, and worry about Unity in a subsequent one. |
@madratman Ideally, there shouldn't be any effect on Unity, since it does all the |
Ah hell, this PR broke the master CI build on Azure, no idea how though |
uh yeah. weird that it didn't happen earlier
the 2nd declaration of vehicle_sim_api inside the for loop is causing a compiler error in windows. Fix is to just rename it to anything else. |
Opened #2998 which fixes this and a Sphinx error |
Example Settings -
I've tested this to make sure that earlier behaviour is unchanged, i.e. if
Vehicle
is not specified, first vehicle is used. And if noSubWindows
settings are specified, then the default windows appear. Any testing would be great!Closes #2838, closes #1172