🔧
bysense
  • How do we bring sensors to walk?
  • Mission Preparation
    • Conventions
    • Out of the Box
    • Select Sensors
      • Front & Back Installation
      • Core Installation
      • Foot Installation
    • Select Power Sources
    • Select Communication Sources
    • Starting Protocol
  • MISSION DEVELOPMENT
    • bysenseSim
    • Setup bysenseSDK
    • Code Examples
    • Start
    • Calibration
    • Movements
    • State estimation
    • Joint Control
  • MIssion Execution
    • Operating Indicators
    • Data Logging Mechanisms
    • System Health Monitoring
    • Error Code and Messages
    • Connectivity Checks
  • Mission Debrief
    • Post-Mission Protocol
    • Maintenance
  • Open source components
    • STEP file
    • Korpus
Powered by GitBook
On this page
  1. MISSION DEVELOPMENT

State estimation

Gravity Vector

the IMU is placed in the middle of bysense. Use following lines to get the gravity vector from bysense.

python
#import the SDK module
import bysense_sdk as bysense

# Create a boolean connection variable of the start class
bysense_connection = bysense.start.connect()

# Verify the connection status
if bysense_connection.is_connected():
    print(bysense_connection.lastlog())
    
    #Get the gravity in x, y, z format 
    grav_vector = bysense.core.gravityvector()
    print(grav_vector)
        
else:
    print(bysense_connection.lastlog())
    # Handle connection failure as needed

C++
#include <iostream>
#include "bysense_sdk.h"  // Include the header file for the SDK

int main() {
    // Create a connection variable of the start class
    auto bysense_connection = bysense::start::connect();

    // Verify the connection status
    if (bysense_connection.is_connected()) {
        std::cout << bysense_connection.lastlog() << std::endl;

        // Get the gravity vector in x, y, z format
        auto grav_vector = bysense::core::gravityvector();
        std::cout << "Gravity Vector: (" 
                  << grav_vector[0] << ", " 
                  << grav_vector[1] << ", " 
                  << grav_vector[2] << ")" 
                  << std::endl;
    } else {
        std::cout << bysense_connection.lastlog() << std::endl;
        // Handle connection failure as needed
    }

    return 0;
}
PreviousMovementsNextJoint Control

Last updated 7 months ago