mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-21 06:01:43 +00:00
d/illixr: Update ILLIXR driver.
This commit is contained in:
parent
27f872fdfc
commit
df9ebf261f
|
@ -24,18 +24,11 @@ class illixr_plugin : public plugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
illixr_plugin(std::string name_, phonebook *pb_)
|
illixr_plugin(std::string name_, phonebook *pb_)
|
||||||
: plugin{name_, pb_}, sb{pb->lookup_impl<switchboard>()}, sb_pose{pb->lookup_impl<pose_prediction>()},
|
: plugin{name_, pb_}, sb{pb->lookup_impl<switchboard>()}, sb_pose{pb->lookup_impl<pose_prediction>()}
|
||||||
sb_eyebuffer{sb->publish<rendered_frame>("eyebuffer")}, sb_vsync_estimate{sb->subscribe_latest<time_type>(
|
|
||||||
"vsync_estimate")}
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
const std::shared_ptr<switchboard> sb;
|
const std::shared_ptr<switchboard> sb;
|
||||||
const std::shared_ptr<pose_prediction> sb_pose;
|
const std::shared_ptr<pose_prediction> sb_pose;
|
||||||
const std::unique_ptr<writer<rendered_frame>> sb_eyebuffer;
|
|
||||||
const std::unique_ptr<reader_latest<time_type>> sb_vsync_estimate;
|
|
||||||
fast_pose_type prev_pose; /* stores a copy of pose each time
|
|
||||||
illixr_read_pose() is called */
|
|
||||||
std::chrono::time_point<std::chrono::system_clock> sample_time; /* when prev_pose was stored */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static illixr_plugin *illixr_plugin_obj = nullptr;
|
static illixr_plugin *illixr_plugin_obj = nullptr;
|
||||||
|
@ -60,9 +53,6 @@ illixr_read_pose()
|
||||||
const fast_pose_type fast_pose = illixr_plugin_obj->sb_pose->get_fast_pose();
|
const fast_pose_type fast_pose = illixr_plugin_obj->sb_pose->get_fast_pose();
|
||||||
const pose_type pose = fast_pose.pose;
|
const pose_type pose = fast_pose.pose;
|
||||||
|
|
||||||
// record when the pose was read for use in write_frame
|
|
||||||
illixr_plugin_obj->sample_time = std::chrono::system_clock::now();
|
|
||||||
|
|
||||||
ret.orientation.x = pose.orientation.x();
|
ret.orientation.x = pose.orientation.x();
|
||||||
ret.orientation.y = pose.orientation.y();
|
ret.orientation.y = pose.orientation.y();
|
||||||
ret.orientation.z = pose.orientation.z();
|
ret.orientation.z = pose.orientation.z();
|
||||||
|
@ -71,8 +61,5 @@ illixr_read_pose()
|
||||||
ret.position.y = pose.position.y();
|
ret.position.y = pose.position.y();
|
||||||
ret.position.z = pose.position.z();
|
ret.position.z = pose.position.z();
|
||||||
|
|
||||||
// store pose in static variable for use in write_frame
|
|
||||||
illixr_plugin_obj->prev_pose = fast_pose; // copy member variables
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ struct xrt_auto_prober *
|
||||||
illixr_create_auto_prober()
|
illixr_create_auto_prober()
|
||||||
{
|
{
|
||||||
struct illixr_prober *dp = U_TYPED_CALLOC(struct illixr_prober);
|
struct illixr_prober *dp = U_TYPED_CALLOC(struct illixr_prober);
|
||||||
dp->base.name = "IlliXR";
|
dp->base.name = "ILLIXR";
|
||||||
dp->base.destroy = illixr_prober_destroy;
|
dp->base.destroy = illixr_prober_destroy;
|
||||||
dp->base.lelo_dallas_autoprobe = illixr_prober_autoprobe;
|
dp->base.lelo_dallas_autoprobe = illixr_prober_autoprobe;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue