🔧
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

Code Examples

Start, Walk & Sit

in following code example you connect to bysense, show the E-Stop button, activate its joints, standup, walk for 120 sec in x direction, sit down and deactivate its joints.

python
#import the SDK module
import bysense_sdk as bysense
import time

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

if bysense_connection.is_connected():

    #print successfull connection
    print(bysense_connection.lastlog())
    
    #open UI in a seperate process to be able to use it
    bysense.start.estop_UI()
    
    #once estop is avaible the joints can be activated
    bysense_active_joints = bysense.start.activate_joints()
    
    #stantup bysense
    bysense.movs.standup()
    
    #turn on the walk bling function with given vector
    bysense.movs.walkblind(walking_vector)
    
    #walk for 120 seconds
    time.sleep(120.0)
    
    #sitdown bysense
    bysense.movs.sitdown()
    
    #once estop is avaible the joints can be activated
    bysense_deactive_joints = bysense.start.deactive_joints()
    

else:
    print(bysense_connection.lastlog())
    # Handle connection failure as needed

With this python code you have written your first application to bring your sensors to walk!

PreviousSetup bysenseSDKNextStart

Last updated 7 months ago