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

Options to set the graphics window camera position #109

Open
Rauldg opened this issue Mar 3, 2020 · 2 comments
Open

Options to set the graphics window camera position #109

Rauldg opened this issue Mar 3, 2020 · 2 comments

Comments

@Rauldg
Copy link
Contributor

Rauldg commented Mar 3, 2020

Depending on the scene that we are loading, we want to set the camera to a particular position from where the robot can be seen. We could provide the camera transformation in either a rock config a scene file or maybe mars conf file.

How can the position of the camera that the user has to see the simulation be set on Mars/Rock+Mars startup? Are there any options?

Currently the simulation camera starts always x=0, y=0, z=5, with alpha=0, beta=0.0, and gamma=0.0.

With the Entity Viewer I can see the position of the camera, under graphics>1:window. Also in View>Configure3DViews I tried to save a camera position but that didn't seem to work.

@Rauldg
Copy link
Contributor Author

Rauldg commented Mar 23, 2020

Here is how I use the save and load camera pose feature, which does not work as I would expect.

Save the camera pose

Move the camera with the mouse to the position that you want to save.

View>Configure 3dView

Lock Position and Lock Rotation

Click on the ... in the Save configuration line.

Select a .txt file that already exists (it won't create a new one).

Click on load.

Load a saved camera pose

View>Configure 3dView

Click on the ... in the Load configuration line.

Select a the camera pose .txt file that contains the camera pose.

Click on save.


-> Expected: Camera position is changed according to position in the file
-> Obtained: The camera position is not changed.

Uploaded is the data that gets stored when calling "save" on the first part. Neither rotation nor position are saved.

test_cam.txt

@Rauldg
Copy link
Contributor Author

Rauldg commented Mar 23, 2020

Save the camera pose that works

Move the camera with the mouse to the position that you want to save.

Edit > Entitity viewer > graphics > 1:window > on the right side, you can see the position and rotation of the camera.

Screenshot from 2020-03-23 14-18-04

Keep those values visible.

View>Configure 3dView

Lock Position and Lock Rotation, extend each of the widgets and copy the camera position and rotation.

Screenshot from 2020-03-23 14-21-20

Click on the ... in the Save configuration line.

Select a .txt file that already exists (it won't create a new one).

Click on save.

After save, the lock_camera flag should be "1" in the saved file but it is not. Modify it manually:

From

$ cat test_cam.txt 
window_id: 1
node_id: 0
lock_camera: 0
lock_rotation: 1
offset_pos: -46.409 -19.5 13.3
offset_euler: 76 0 -98
offset_rot: 0.40391 -0.464646 -0.594719 0.516982
frustum: -0.0491641 0.0491641 -0.054197 0.054197 0.116226 237.101

To

$ cat test_cam.txt 
window_id: 1
node_id: 0
lock_camera: 1
lock_rotation: 1
offset_pos: -46.409 -19.5 13.3
offset_euler: 76 0 -98
offset_rot: 0.40391 -0.464646 -0.594719 0.516982
frustum: -0.0491641 0.0491641 -0.054197 0.054197 0.116226 237.101

Load a saved camera pose

View>Configure 3dView

Click on the ... in the Load configuration line.

Select a the camera pose .txt file that contains the camera pose.

Click on load.

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

No branches or pull requests

1 participant