Adding Motors and Sensors to a Model
This tutorial will show how to add sensors and motors to a model to be used with FRCsim
Define Links and Joints
Before adding in any attachments, you must check "enable FRCsim Components" in the Exporter Settings.
Also, the model should first have all of its links and joints defined. A tutorial on how to do this can be found here under the "Define Joints" section: http://wpilib.screenstepslive.com/s/4485/m/23353/l/349026-exporting-a-solidworks-model-to-gazebo. Once those have been defined, open the Manage Robot window.
To add an attachment, simply drag the desired type of attachment from the bottom bar onto the link you want to apply it to. If an attachment affects a joint, it will affect the joint between the link it is on and its parent link, and it cannot be put on the base link. Attachments that affect joints are: simple motor, quadrature encoder, potentiometer, internal limit switch, and piston.
Edit Attachment Properties
To edit the properties of an attachment, simply click on the desired one in the graph window. A property page will appear on the right side of the window with boxes to edit the various properties for each attachment. The attachment can also be deleted here by pressing the Delete button.
Attachments for joints
Set the Attachment Position
For some attachments (rangefinder and camera), you must specify the point on the robot where it is located and a radius/field of view by clicking the "Attachment Pose" button, which opens the Solidworks window where you can select a point on the model.
To define an attachment's location, click on any vertex or reference point in the physical configuration model (not the collision models).This point will be the location that the attachment is located at.
To define the direction it looks, you can click on any edge or axis and toggle the direction button as necessary, or you can manually specify the rotations to be applied. The rotations are applied in the order of roll, then pitch, then yaw. Once a location and direction are specified a preview will appear showing the view of the attachment. The field of view of the attachment can also be adjusted using the slider.
List of currently supported attachments
A video on tuning motors in Gazebo can be found here: