(FRC 2015) Robot Simulation Tutorial
(FRC 2015) Robot Simulation Tutorial
Contents
1.
2.
3.
4.
5.
6.
Introduction
Opening the Robot Simulator
Using the FRC Simulator Viewer
Programming a Simulated Robot
Supported Actuators and Sensors on the Simulated Robots
Notes
Introduction
Use the LabVIEW Robot Simulation to program a predefined robot without having an RT roboRIO
Target. This allows multiple developers to concurrently create and test LabVIEW code without requiring
each developer to have access to the hardware. Programming is the same, except only the predefined
Actuators and Sensors on the simulated robot are currently supported. Robot code that has been
developed and works in simulation mode can be moved to the RT roboRIO Target and run on a real
robot.
Opening the Robot Simulator
1. Start the FRC Driver Station. This is required for both real and simulated robots.
2. Open a New FRC roboRIO Robot Project either from the Getting Started window or by going to
FileNew
3. Update the Team Number by using your Team Number. This will automatically determine the
IP for you. You can choose any of the roboRIO project options to access the simulator. The
Arcade Drive Robot cRIO does not support the simulator.
4. When the LabVIEW Project opens, select and open Robot Main.vi.
5. Right-click in the lower left corner of Robot Main.vi and choose 2015 Robot Project
Tutorial.lvproj/My Computer. Wait a moment while the subVIs reload. Be aware the name will
match the name you chose for your project and may be different than the name used here.
7. The FRC Driver Station should now show that you are in Simulated Robot Mode. Click Enable to
place the robot in Teleoperated Enabled Mode.
8. You should now be able to use a joystick to drive the robot in the FRC Simulation Viewer.
9. The camera image and Drive can be monitored in the FRC PC Dashboard. Change the
Camera to IP Camera to view the camera. The camera can be changed using the dropdown
menu at the bottom of the Drive tab in the center of the FRC PC Dashboard window. Left-click
the resolution to change the Frame Rate and Compression. Changing to a lower frame rate will
help performance on slower computers.
Aside from Teleoperation of the simulated robot using the joystick, there are several options in the FRC
Simulator Viewer to help customize your simulation environment:
Simulate Run and Pause buttons are available.
Time Factor Allows you to run the dynamic model of the system slower than real time
(minimum 0.25) and faster than real time (maximum 20.0). A Time Factor of 1.0 will be
representative of the system in real time.
View Side or Driver enables you to default back to one of the two traditional points of
view. If Follow is Off, left-clicking and panning in the Viewer window will allow you to choose a
custom viewing angle.
Follow If you turn Follow On, the Viewer will keep the robot centered in the screen from
whichever View you have selected. If you turn Follow Off, left-clicking and panning in the
Viewer window will allow you to choose a custom viewing angle, but zooming is no longer
possible.
Color Selects the background color.
Driver Station IP Auto should be set to connect with the correct IP Address based on the RT
roboRIO Target properties in the LabVIEW Project Explorer, but there is also an option
to Set the IP address manually.
Close Close the FRC Simulation Viewer and stop Robot Main.vi.
Analog Channel = AI 1
4. Ultrasonic
Ping Digital Module = Digital Module 1
Ping DIO Channel = DIO 1
Echo Digital Module = Digital Module 1
Echo DIO Channel = DIO 2
5. AXIS M1011 Camera
3. Mecanum Robot with Arm
Actuators on the simulated robot
1. Left Front Motor
Digital Module = Digital Module 1
PWM Channel = PWM 1
2. Right Front Motor
Digital Module = Digital Module 1
PWM Channel = PWM 2
3. Left Rear Motor
Digital Module = Digital Module 1
PWM Channel = PWM 3
4. Right Rear Motor
Digital Module = Digital Module 1
PWM Channel = PWM 4
5. Camera Servo
Digital Module = Digital Module 1
PWM Channel = PWM 5
Angular Range = 170
6. Arm Servo
Digital Module = Digital Module 1
PWM Channel = PWM 6
Angular Range = 170
7. Gripper Servo
Digital Module = Digital Module 1
PWM Channel = PWM 7
Angular Range = 170
Sensors on the simulated robot
1. Encoder on Right Motor
Digital Module = Digital Module 1
A Channel = DIO 3
B Channel = DIO 4
2. Encoder on Left Motor
Digital Module = Digital Module 1
A Channel = DIO 5
B Channel = DIO 6
3. Gyro