Browse Source

SITL: example for steering/throttle rover

c415-sdk
ashvath 5 years ago committed by Andrew Tridgell
parent
commit
677dec5894
  1. 20
      libraries/SITL/examples/Morse/rover.py

20
libraries/SITL/examples/Morse/rover.py

@ -12,16 +12,15 @@ Then connect with ArduPilot like this:
sim_vehicle.py --model morse --console --map sim_vehicle.py --model morse --console --map
This model assumes you will setup a skid-steering rover with left throttle on This model assumes you will setup a steering/throttle rover
channel 1 and right throttle on channel 2, which means you need to set:
SERVO1_FUNCTION 73 SERVO1_FUNCTION 26
SERVO3_FUNCTION 74 SERVO3_FUNCTION 70
''' '''
from morse.builder import * from morse.builder import *
# use the ATRV rover # use the Hummer
vehicle = ATRV() vehicle = Hummer()
vehicle.properties(Object = True, Graspable = False, Label = "Vehicle") vehicle.properties(Object = True, Graspable = False, Label = "Vehicle")
vehicle.translate(x=0.0, z=0.0) vehicle.translate(x=0.0, z=0.0)
@ -55,12 +54,9 @@ all_sensors.add_stream('socket')
vehicle.append(all_sensors) vehicle.append(all_sensors)
# make the vehicle controllable with speed and angular velocity # make the vehicle controllable with steer and force
# this will be available on port 60001 by default # this will be available on port 60001 by default
# an example command is: motion = SteerForce()
# {"v":2, "w":1}
# which is 2m/s fwd, and rotating left at 1 radian/second
motion = MotionVW()
vehicle.append(motion) vehicle.append(motion)
motion.add_stream('socket') motion.add_stream('socket')
@ -78,4 +74,4 @@ env.select_display_camera(camera)
env.set_camera_clip(clip_end=1000) env.set_camera_clip(clip_end=1000)
# startup at CMAC. A location is needed for the magnetometer # startup at CMAC. A location is needed for the magnetometer
env.properties(longitude = 149.165230, latitude = -35.363261, altitude = 584.0) env.properties(longitude = 149.165230, latitude = -35.363261, altitude = 584.0)
Loading…
Cancel
Save