kougaku / RealSenseOSC

OSC sender for RealSense T265
MIT License
29 stars 8 forks source link

how to run this work on UBuntu? #2

Open jingshaojing opened 3 years ago

jingshaojing commented 3 years ago

how can I run this on Ubuntu? In librealsense example ,I can get position from rs-pose.cpp? how can I get attitude data from t265 directly? what is the interface? In other words , how does this work get t265's attitude in the windows form? I am sorry for my poor english

kougaku commented 3 years ago

Sorry, this code is just only for Windows. It's written on Visual Studio. The code getting sensor data is based on librealsense/examples/pose/rs-pose.cpp. The interface is based on "MFC dialog based application". I used thread in order to achieve both updating the interface and data acquisition / transmission at the same time.

jingshaojing commented 3 years ago

thanks for your  answer ,the interface I mean is program interface from sdk in which you get attitude data   ?rs.cpp can only get pose data   

---Original--- From: "Sunao Hashimoto"<notifications@github.com> Date: Fri, Oct 23, 2020 22:04 PM To: "kougaku/RealSenseOSC"<RealSenseOSC@noreply.github.com>; Cc: "jingshaojing"<2638117940@qq.com>;"Author"<author@noreply.github.com>; Subject: Re: [kougaku/RealSenseOSC] how to run this work on UBuntu? (#2)

Sorry, this code is just only for Windows. It's written on Visual Studio. The code getting sensor data is based on librealsense/examples/pose/rs-pose.cpp. The interface is based on "MFC dialog based application". I used thread in order to achieve both updating the interface and data acquisition / transmission at the same time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

kougaku commented 3 years ago

OK, I see. Here is the code.

Line192-204 in RealSenseOSC/Sender (Visual Studio)/RealSenseOSC/RealSenseOSCDlg.cpp

    // Cast the frame to pose_frame and get its data
    auto pose_data = f.as<rs2::pose_frame>().get_pose_data();

    p.Clear();
    p << osc::BeginBundleImmediate
        << osc::BeginMessage("/realsense")
        << pose_data.translation.x
        << pose_data.translation.y
        << pose_data.translation.z
        << pose_data.rotation.w
        << pose_data.rotation.x
        << pose_data.rotation.y
        << pose_data.rotation.z

Here, .rotation.w, .rotation.x, .rotation.y, and .rotation.z are quotation parameters expressing 3D rotation.

jingshaojing commented 3 years ago

thanks,this is exactly I needed。

---Original--- From: "Sunao Hashimoto"<notifications@github.com> Date: Fri, Oct 23, 2020 23:01 PM To: "kougaku/RealSenseOSC"<RealSenseOSC@noreply.github.com>; Cc: "jingshaojing"<2638117940@qq.com>;"Author"<author@noreply.github.com>; Subject: Re: [kougaku/RealSenseOSC] how to run this work on UBuntu? (#2)

OK, I see.

Here is the code. Line192-204 in RealSenseOSC/Sender (Visual Studio)/RealSenseOSC/RealSenseOSCDlg.cpp // Cast the frame to pose_frame and get its data auto pose_data = f.as<rs2::pose_frame>().get_pose_data(); p.Clear(); p << osc::BeginBundleImmediate << osc::BeginMessage("/realsense") << pose_data.translation.x << pose_data.translation.y << pose_data.translation.z << pose_data.rotation.w << pose_data.rotation.x << pose_data.rotation.y << pose_data.rotation.z

Here, .rotation.w, .rotation.x, .rotation.y, and .rotation.z are quotation parameters expressing 3D rotation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

kougaku commented 3 years ago

Yeah! Glad to hear that. Have a nice coding!

jingshaojing commented 3 years ago

thanks !

---Original--- From: "Sunao Hashimoto"<notifications@github.com> Date: Fri, Oct 23, 2020 23:09 PM To: "kougaku/RealSenseOSC"<RealSenseOSC@noreply.github.com>; Cc: "jingshaojing"<2638117940@qq.com>;"Author"<author@noreply.github.com>; Subject: Re: [kougaku/RealSenseOSC] how to run this work on UBuntu? (#2)

Yeah! Glad to hear that. Have a nice coding!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.