Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
vpMocapVicon Class Reference

#include <visp3/sensor/vpMocapVicon.h>

+ Inheritance diagram for vpMocapVicon:

Public Member Functions

 vpMocapVicon ()
 
virtual ~vpMocapVicon ()
 
void close ()
 
bool connect ()
 
bool getBodiesPose (std::map< std::string, vpHomogeneousMatrix > &bodies_pose, bool all_bodies=false)
 
bool getSpecificBodyPose (const std::string &body_name, vpHomogeneousMatrix &body_pose)
 
void setServerAddress (const std::string &serverAddr)
 
void setVerbose (bool verbose)
 

Protected Attributes

bool m_verbose
 
std::string m_serverAddr
 

Detailed Description

Vicon motion capture wrapper.

Examples
testMocapVicon.cpp.

Definition at line 51 of file vpMocapVicon.h.

Constructor & Destructor Documentation

◆ vpMocapVicon()

BEGIN_VISP_NAMESPACE vpMocapVicon::vpMocapVicon ( )

Default constructor that creates a direct client (not a multi-cast client).

Definition at line 216 of file vpMocapVicon.cpp.

◆ ~vpMocapVicon()

vpMocapVicon::~vpMocapVicon ( )
virtual

Destructor.

Definition at line 221 of file vpMocapVicon.cpp.

Member Function Documentation

◆ close()

void vpMocapVicon::close ( )
virtual

Close connexion with Vicon by stopping the capture.

Implements vpMocap.

Definition at line 226 of file vpMocapVicon.cpp.

◆ connect()

bool vpMocapVicon::connect ( )
virtual

Connect to Vicon mocap server with IP address set using setServerAddress().

Returns
true when connection succeed, false otherwise.

Implements vpMocap.

Examples
testMocapVicon.cpp.

Definition at line 233 of file vpMocapVicon.cpp.

◆ getBodiesPose()

bool vpMocapVicon::getBodiesPose ( std::map< std::string, vpHomogeneousMatrix > &  bodies_pose,
bool  all_bodies = false 
)
virtual

Gets the pose of the different bodies.

Parameters
[out]bodies_pose: Map of body names and corresponding poses.
[in]all_bodies: When true, consider all bodies, even those that are not visible and that contain nan in their pose.
Returns
true if the operation was successful.

Implements vpMocap.

Examples
testMocapVicon.cpp.

Definition at line 242 of file vpMocapVicon.cpp.

◆ getSpecificBodyPose()

bool vpMocapVicon::getSpecificBodyPose ( const std::string &  body_name,
vpHomogeneousMatrix body_pose 
)
virtual

Gets the pose of a specific body.

Parameters
[out]body_pose: The homogeneous transformation matrix for the specific body.
[in]body_name: The name of the body.
Returns
true if the operation was successful.

Implements vpMocap.

Examples
testMocapVicon.cpp.

Definition at line 253 of file vpMocapVicon.cpp.

◆ setServerAddress()

void vpMocapVicon::setServerAddress ( const std::string &  serverAddr)
virtual

Set mocap server address.

Parameters
[in]serverAddr: Server address.
See also
connect()

Reimplemented from vpMocap.

Examples
testMocapVicon.cpp.

Definition at line 264 of file vpMocapVicon.cpp.

◆ setVerbose()

void vpMocapVicon::setVerbose ( bool  verbose)
virtual

Enable or disable verbose mode.

Parameters
[in]verbose: When true enable verbose mode, otherwise disable verbose mode.

Reimplemented from vpMocap.

Examples
testMocapVicon.cpp.

Definition at line 270 of file vpMocapVicon.cpp.

Member Data Documentation

◆ m_serverAddr

std::string vpMocap::m_serverAddr
protectedinherited

Definition at line 106 of file vpMocap.h.

◆ m_verbose

bool vpMocap::m_verbose
protectedinherited

Definition at line 105 of file vpMocap.h.