Skip to content
Snippets Groups Projects
Verified Commit 6cb485d8 authored by Trim Bresilla's avatar Trim Bresilla
Browse files

ADD: basic sim

parent ed068bd4
Branches
No related tags found
No related merge requests found
"""my_controller controller."""
# You may need to import some classes of the controller module. Ex:
# from controller import Robot, Motor, DistanceSensor
from controller import Robot
# create the Robot instance.
robot = Robot()
# get the time step of the current world.
timestep = int(robot.getBasicTimeStep())
# You should insert a getDevice-like function in order to get the
# instance of a device of the robot. Something like:
motor = robot.getDevice('moose')
ds = robot.getDevice('dsname')
ds.enable(timestep)
# Main loop:
# - perform simulation steps until Webots is stopping the controller
while robot.step(timestep) != -1:
# Read the sensors:
# Enter here functions to read sensor data, like:
val = ds.getValue()
# Process sensor data here.
# Enter here functions to send actuator commands, like:
motor.setPosition(10.0)
#pass
# Enter here exit cleanup code.
Webots Project File version R2022a
perspectives: 000000ff00000000fd00000002000000010000026d0000082afc0200000001fb0000001400540065007800740045006400690074006f007201000000140000082a0000008900ffffff00000003000006cf000000d9fc0100000001fb0000001a0043006f006e0073006f006c00650041006c006c0041006c006c0100000000000006cf000000000000000000000af90000082a00000001000000020000000100000008fc00000000
simulationViewPerspectives: 000000ff00000001000000020000016e00000a8e0100000002010000000100
sceneTreePerspectives: 000000ff0000000100000002000000c0000000fa0100000002010000000200
maximizedDockId: -1
centralWidgetVisible: 1
orthographicViewHeight: 1
textFiles: 0 "controllers/my_controller/my_controller.py"
#VRML_SIM R2022a utf8
WorldInfo {
}
Viewpoint {
orientation -0.11983785308044682 0.09382975071411193 0.9883495671319924 1.4440953869710094
position -3.074267466187142 -77.90569219932617 28.125151217528988
}
Moose {
hidden position_0_0 0.00013306353513683865
hidden position_0_1 -4.657893805559212e-05
hidden position_0_2 0.0001589276949843798
hidden position_0_3 -0.0002606719988015476
hidden position_0_4 0.00014068689332475537
hidden position_0_5 -0.0002724002604920586
hidden position_0_6 3.3789255993892166e-05
hidden position_0_7 5.085251207931985e-05
hidden rotation_1 -1 0 0 0.00013306353484261992
hidden rotation_2 1 0 0 4.657894196759461e-05
hidden rotation_3 -1 0 0 0.00015892769608741148
hidden rotation_4 1 0 0 0.00026067199915484493
hidden rotation_5 1 0 0 0.00014068689374689748
hidden rotation_6 -1 0 0 0.000272400259960944
hidden rotation_7 1 0 0 3.378924962947211e-05
hidden rotation_8 1 0 0 5.085250883067676e-05
translation 3.4488554728007257 -15.9620195668529 1.2391590877792884
rotation 0.034120978313643 -0.023631249584012064 -0.9991382901690927 1.5698848341583316
controller "my_controller"
}
TexturedBackground {
}
TexturedBackgroundLight {
texture "morning_cloudy_empty"
luminosity 2
}
UnevenTerrain {
size 50 50 2
appearance Grass {
textureTransform TextureTransform {
scale 10 10
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment