123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- '''
- This is an example builder script that sets up a rover in Morse to
- be driven by ArduPilot.
- The rover has the basic set of sensors that ArduPilot needs
- To start the simulation use this:
- morse run rover.py
- Then connect with ArduPilot like this:
- sim_vehicle.py --model morse --console --map
- This model assumes you will setup a skid-steering rover with left throttle on
- channel 1 and right throttle on channel 2, which means you need to set:
- SERVO1_FUNCTION 73
- SERVO3_FUNCTION 74
- '''
- from morse.builder import *
- vehicle = ATRV()
- vehicle.properties(Object = True, Graspable = False, Label = "Vehicle")
- vehicle.translate(x=0.0, z=0.0)
- camera = SemanticCamera(name="Camera")
- camera.translate(x=0.2, y=0.3, z=0.9)
- vehicle.append(camera)
- camera.properties(cam_far=800)
- camera.properties(Vertical_Flip=True)
- pose = Pose()
- vehicle.append(pose)
- imu = IMU()
- vehicle.append(imu)
- gps = GPS()
- gps.alter('UTM')
- vehicle.append(gps)
- velocity = Velocity()
- vehicle.append(velocity)
- all_sensors = CompoundSensor([imu, gps, velocity, pose])
- all_sensors.add_stream('socket')
- vehicle.append(all_sensors)
- motion = MotionVW()
- vehicle.append(motion)
- motion.add_stream('socket')
- env = Environment('land-1/trees')
- env.set_camera_location([10.0, -10.0, 10.0])
- env.set_camera_rotation([1.0470, 0, 0.7854])
- env.select_display_camera(camera)
- env.set_camera_clip(clip_end=1000)
- env.properties(longitude = 149.165230, latitude = -35.363261, altitude = 584.0)
|