rofunc.devices.xsens.src.load_mvnx#
Script to load an mvnx
1. Module Contents#
1.1. Functions#
This function opens and reads the file as an mvnx formatted XML file |
|
Parse the sensor element |
|
Parse the joint element |
|
Parse the ergo joint element |
|
Parse the segment element |
|
Parse the frames element |
|
Extract joint data from a frame |
|
Extract segment data from a frame |
|
Extract segment data from a frame |
|
Extract sensor data from a frame |
|
Extract finger data from a frame |
|
Extract contact data from a frame |
|
Find a named element in a frame element, extract the text from it, split that and return the values as an array of floats |
|
1.2. Data#
1.3. API#
- rofunc.devices.xsens.src.load_mvnx.ns = None#
- rofunc.devices.xsens.src.load_mvnx.FOOT_CONTACT_MAP = None#
- rofunc.devices.xsens.src.load_mvnx.load_mvnx(file_name)[source]#
This function opens and reads the file as an mvnx formatted XML file
- Parameters:
file_name – Name of the file to open, must have full path and .mvnx extension
- Returns:
A dictionary with the data from the mvnx file
- rofunc.devices.xsens.src.load_mvnx.parse_sensor(sensors_element, segment_names)[source]#
Parse the sensor element
- Parameters:
sensors_element – The joint element to parse
segment_names – a list with the segment names
- Returns:
a dictionary with sensor data indexed by sensor name and a list with the sensor names
- rofunc.devices.xsens.src.load_mvnx.parse_joints(joints_element, segments)[source]#
Parse the joint element
- Parameters:
joints_element – The joint element to parse
segments – The dictionary with segment data
- Returns:
a dictionary with joint data indexed by joint name and a list with the joint names
- rofunc.devices.xsens.src.load_mvnx.parse_ergo_joints(ergo_joints_element)[source]#
Parse the ergo joint element
- Parameters:
ergo_joints_element – The joint element to parse
- Returns:
a dictionary with ergo joint data indexed by joint name and a list with the ergo joint names
- rofunc.devices.xsens.src.load_mvnx.parse_segments(segment_elements)[source]#
Parse the segment element
- Parameters:
segment_elements – The segment element to parse
- Returns:
a dictionary a list with the segment names and segment data indexed by segment name
- rofunc.devices.xsens.src.load_mvnx.get_connector_indices(joint_element, connector, segments)[source]#
- rofunc.devices.xsens.src.load_mvnx.parse_frames(frames_element, mvnx_file)[source]#
Parse the frames element
- Parameters:
frames_element – The frames element to parse
mvnx_file – a dictionary containing, among others, a list of names
- Returns:
a dictionary with frames data
- rofunc.devices.xsens.src.load_mvnx.get_joint_data_from_frame(frame_element, joint_element_name, joint_names)[source]#
Extract joint data from a frame
- Parameters:
frame_element – The frame element to process
joint_element_name – The name of the frame element to process
joint_names – a list with the joint names
- Returns:
a dictionary with joint data indexed by joint name
- rofunc.devices.xsens.src.load_mvnx.get_t_pose_data_from_frame(frame_element, segment_names)[source]#
Extract segment data from a frame
- Parameters:
frame_element – The frame element to process
segment_names – a list with the segment names
- Returns:
a dictionary with segment data indexed by segment name
- rofunc.devices.xsens.src.load_mvnx.get_segment_data_from_frame(frame_element, segment_names)[source]#
Extract segment data from a frame
- Parameters:
frame_element – The frame element to process
segment_names – a list with the segment names
- Returns:
a dictionary with segment data indexed by segment name
- rofunc.devices.xsens.src.load_mvnx.get_sensor_data_from_frame(frame_element, sensor_names)[source]#
Extract sensor data from a frame
- Parameters:
frame_element – The frame element to process
sensor_names – a list with the segment names
- Returns:
a dictionary with sensor data indexed by sensor name
- rofunc.devices.xsens.src.load_mvnx.get_finger_data_from_frame(frame_element, finger_segment_names)[source]#
Extract finger data from a frame
- Parameters:
frame_element – The frame element to process
finger_segment_names – a list with the finger segment names
- Returns:
a dictionary with finger data indexed by finger name
- rofunc.devices.xsens.src.load_mvnx.get_contact_data_from_frame(frame_element, foot_contact_def)[source]#
Extract contact data from a frame
- Parameters:
frame_element – The frame element to process
foot_contact_def – a list with the foot contact definitions
- Returns:
a list with contacts
- rofunc.devices.xsens.src.load_mvnx.frame_element_as_floats(frame_element, element)[source]#
Find a named element in a frame element, extract the text from it, split that and return the values as an array of floats
- Parameters:
frame_element – The mvnx frame element to process
element – The name of the sub element to find
- Returns:
an array of floating point values