Skip to content

Commit

Permalink
Finalize the first implementation of OpenXRModule
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Sep 29, 2021
1 parent 0b5c769 commit 84f0d9c
Show file tree
Hide file tree
Showing 2 changed files with 626 additions and 535 deletions.
175 changes: 0 additions & 175 deletions modules/OpenXR_module/include/OpenXRModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,181 +33,6 @@ class OpenXRModule : public yarp::os::RFModule
struct Impl;
std::unique_ptr<Impl> m_pImpl;

// double m_dT; /**< Module period. */

// /** Oculus Finite state machine */
// enum class OculusFSM
// {
// Configured,
// Running,
// InPreparation
// };

// OculusFSM m_state; /**< State of the OculusFSM */

// // joypad utils
// // TODO move in a separate class
// double m_deadzone; /**< Joypad deadzone */
// double m_fullscale; /**< Joypad fullscale */
// double m_scaleX; /**< Scaling factor on the x axis */
// double m_scaleY; /**< Scaling factor on the y axis */
// double m_joypadX; /**< x value */
// double m_joypadY; /**< y value */

// unsigned int m_xJoypadIndex; /**< Mapping of the axis related to x coordinate */
// unsigned int m_yJoypadIndex; /**< Mapping of the axis related to y coordinate */

// unsigned int m_squeezeLeftIndex; /**< Index of the trigger used for squeezing the left hand */
// unsigned int m_squeezeRightIndex; /**< Index of the trigger used for squeezing the right hand */

// unsigned int m_releaseLeftIndex; /**< Index of the trigger used for releasing the left hand */
// unsigned int m_releaseRightIndex; /**< Index of the trigger used for releasing the right hand */

// unsigned int m_startWalkingIndex; /**< Index of the start walking button */
// unsigned int m_stopWalkingIndex; /**< Index of the stop walking button */
// unsigned int m_prepareWalkingIndex; /**< Index of the prepare walking button */

// bool m_useVirtualizer; /**< True if the virtualizer is used in the retargeting */
// bool m_useXsens; /**< True if the Xsens is used in the retargeting */
// bool m_useIFeel; /**< True if the iFeel is used in the retargeting */
// bool m_useOpenXr; /**< True if OpenXr is used in the retargeting */
// bool m_useSenseGlove; /**< True if the SenseGlove is used in the retargeting */
// bool m_moveRobot; /**< the option to give the user the possibility to do not move the robot
// (default :: true)*/

// // transform server
// yarp::dev::PolyDriver m_transformClientDevice; /**< Transform client. */
// yarp::dev::IFrameTransform* m_frameTransformInterface{nullptr}; /**< Frame transform
// interface. */
// std::string m_rootFrameName; /**< Name of the root frame used in the transform server */
// std::string m_headFrameName; /**< Name of the head frame used in the transform server (NOT
// SUPPORTED BY YARP)*/
// std::string
// m_leftHandFrameName; /**< Name of the left hand frame used in the transform server */
// std::string
// m_rightHandFrameName; /**< Name of the right hand frame used in the transform server */

// yarp::dev::PolyDriver m_joypadDevice; /**< Joypad polydriver. */
// yarp::dev::IJoypadController* m_joypadControllerInterface{nullptr}; /**< joypad interface. */

// std::unique_ptr<HeadRetargeting> m_head; /**< Pointer to the head retargeting object. */
// std::unique_ptr<FingersRetargeting> m_leftHandFingers; /**< Pointer to the left
// finger retargeting object. */
// std::unique_ptr<FingersRetargeting> m_rightHandFingers; /**< Pointer to the right
// finger retargeting object. */
// std::unique_ptr<HandRetargeting> m_rightHand; /**< Pointer to the right
// hand retargeting object. */
// std::unique_ptr<HandRetargeting> m_leftHand; /**< Pointer to the left hand
// retargeting object. */

// // ports
// yarp::os::BufferedPort<yarp::sig::Vector> m_leftHandPosePort; /**< Left hand port pose. */
// yarp::os::BufferedPort<yarp::sig::Vector> m_rightHandPosePort; /**< Right hand port pose. */

// /** Player orientation port. */
// yarp::os::BufferedPort<yarp::sig::Vector> m_playerOrientationPort;
// /** Port used to simulate an imu for moving the images. */
// yarp::os::BufferedPort<yarp::os::Bottle> m_imagesOrientationPort;
// /** Port used to retrieve the robot base orientation. */
// yarp::os::BufferedPort<yarp::sig::Vector> m_robotOrientationPort;
// /** Port used to retrieve the headset oculus orientation. */
// yarp::os::BufferedPort<yarp::os::Bottle> m_oculusOrientationPort;
// /** Port used to retrieve the headset oculus position. */
// yarp::os::BufferedPort<yarp::os::Bottle> m_oculusPositionPort;

// yarp::os::RpcClient m_rpcWalkingClient; /**< Rpc client used for sending command to the walking
// controller */
// yarp::os::RpcClient
// m_rpcVirtualizerClient; /**< Rpc client used for sending command to the virtualizer */

// /** Port used to retrieve the human whole body joint pose. */
// yarp::os::BufferedPort<yarp::os::Bottle> m_wholeBodyHumanJointsPort;

// /** Port used to retrieve the human whole body joint pose. */
// yarp::os::BufferedPort<yarp::sig::Vector> m_wholeBodyHumanSmoothedJointsPort;

// double m_robotYaw; /**< Yaw angle of the robot base */

// yarp::sig::Matrix m_oculusRoot_T_lOculus;
// yarp::sig::Matrix m_oculusRoot_T_rOculus;
// yarp::sig::Matrix m_oculusRoot_T_headOculus;
// yarp::sig::Matrix m_openXrInitialAlignement;

// std::vector<double> m_oculusHeadsetPoseInertial;

// double m_playerOrientation{0}; /**< Player orientation (read by the Virtualizer)
// only yaw. */
// double m_playerOrientationOld{0}; /**< previous updated Player orientation (read by the
// Virtualizer) only yaw. */
// double m_playerOrientationThreshold; /**< Player orientation threshold. */

// bool m_enableLogger; /**< log the data (if ON) */
// #ifdef ENABLE_LOGGER
// XBot::MatLogger2::Ptr m_logger; /**< */
// XBot::MatAppender::Ptr m_appender;
// std::string m_logger_prefix{"oculus"};
// #endif
// /**
// * Configure the Oculus.
// * @param config configuration object
// * @return true in case of success and false otherwise.
// */
// bool configureOculus(const yarp::os::Searchable& config);

// /**
// * Configure the Tranformation Client.
// * @param config configuration object
// * @return true in case of success and false otherwise.
// */
// bool configureTranformClient(const yarp::os::Searchable& config);

// /**
// * Configure the Joypad.
// * @param config configuration object
// * @return true in case of success and false otherwise.
// */
// bool configureJoypad(const yarp::os::Searchable& config);

// /**
// * @brief Reset a robot camera to its default settings.
// * @param cameraPort The remote port to the camera
// * @param localPort The local port needed for the driver to open
// * @return true in case of success and false otherwise.
// */
// bool resetCamera(const std::string& cameraPort, const std::string& localPort);

// /**
// * Get all the feedback signal from the interfaces
// * @return true in case of success and false otherwise.
// */
// bool getFeedbacks();

// /**
// * Implements a deadzone for the joypad
// * @return joypad inputs after applying deadzone.
// */
// double deadzone(const double&);

// /**
// * Evaluate the desired fingers velocity
// * @param squeezeIndex index used for squeezing
// * @param releaseIndex index used for releasing
// * @return the the desired joints velocity for the fingers in radiant / seconds
// */
// double evaluateDesiredFingersVelocity(unsigned int squeezeIndex, unsigned int releaseIndex);

// /**
// * Get the transformation from the transform server
// * @return true in case of success and false otherwise.
// */
// bool getTransforms();

// /**
// * Open the logger
// * @return true if it could open the logger
// */
// bool openLogger();

public:
OpenXRModule();
~OpenXRModule();
Expand Down
Loading

0 comments on commit 84f0d9c

Please sign in to comment.