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

Add SteamVR module for tracking #779

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

IamPete1
Copy link
Member

This adds a module that reads in the pose from a SteamVR Tracker using PYopenVR. The tracker provides position, velocity, attitude and attitude rate at 144HZ. This is then dished out in GPS or VISION messages at a set rate.

https://youtu.be/P7J486V5__A

My first MAVProxy PR and also my first proper bash as Python so apologies for any mistakes.

I ended up using a OpenVR example code to go from the provided matrix to roll pitch and yaw. I couldn't workout the ordering to use the existing one.

I will do a better vid explaining how to setup in the next day or so.

@IamPete1
Copy link
Member Author

Copy link
Contributor

@stephendade stephendade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting I don't have a SteamVR, this review is somewhat limited to basic MAVProxy module functionality.

MAVProxy/modules/mavproxy_steamvr.py Outdated Show resolved Hide resolved
MAVProxy/modules/mavproxy_steamvr.py Outdated Show resolved Hide resolved
MAVProxy/modules/mavproxy_steamvr.py Outdated Show resolved Hide resolved

# send origin at 1Hz
mav.mav.set_gps_global_origin_send(self.target_system,
int(self.vr_settings.origin_lat*1.0e7),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this only had to be sent once?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It only has to be received once, I guess this is easier than trying to tell. This is completely left over from the Vicon stuff.

fix_type = 3
else:
fix_type = 1
mav.mav.gps_input_send(time_us, 0, 0, gps_week_ms, gps_week, fix_type,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does gps_input need to be sent if you're also sending global_vision_position_estimate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just gives the option, by default the gps stream rate is 0

MAVProxy/modules/mavproxy_steamvr.py Show resolved Hide resolved
MAVProxy/modules/mavproxy_steamvr.py Show resolved Hide resolved
@IamPete1
Copy link
Member Author

I have made this a good deal more robust, stop and start work properly now, the only way I have found to break it is to shut steam vr while its being used. I think this is more due to issues with PyOpenVR than this. SteamVR does give a 'are you sure python still running' warning so I don't think its a disaster.

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.

None yet

2 participants