Mechanical-Advantage / AdvantageScope

Robot telemetry application for FRC
https://docs.advantagescope.org/
MIT License
177 stars 52 forks source link

Importing CAD model and components into simulator not intuitive #151

Open team3572 opened 8 months ago

team3572 commented 8 months ago

Describe the question you have. Our CAD team exported the robot base as a model and the arm mechanism as a model. (OnShape is the CAD program)

Describe the reason for your confusion. Robot base imports fine (we raise it a little in the config to make it look like the wheels sit on the floor) The arm component model looks like it imports fine as well. In as far as when, in AS, I add the robot pose as a 2D pose the robot is where I expect it to be and the arm component must default in as well by virtue of just having a model_0 in the assets folder. In my config file all I do to the robot is rotate it 90 on the X and 90 on the Z and I do the same rotations for the component.

Is your question related to a problem? Please describe. The issue is when I add a Arm Component pose (pose3D) to the log so I can add it to AS. The pose I'm adding is hard coded to all zeros. When I drag this pose to the 3D Poses section and make it a Component (Robot) the arm all of the sudden is at an angle, it is several feet not through the bottom of the floor and the X and Y offset are bad as well.

Additional context So, what could we do better or what are we not doing to make this component not match up to the robot base?

jwbonner commented 8 months ago

Based on your description, I think that what you're seeing is the expected behavior. Here's the description from the documentation:

When no component poses are provided by the user in AdvantageScope, the component models will be positioned using the default robot rotations and position (see above). When component poses are provided by the user, the "zeroed" rotations and position are instead applied to bring each component to the robot origin. The user's poses are then applied to move each component to the correct location on the robot.

Thus the "zeroed" position/rotations of the components are unused when a 3D component pose is not provided by the user. The idea is to make it easy to use their "default" positions when not providing component poses. However, once you drag out 3D poses the "zeroed" position/rotations are used to bring the components to a known origin location for positioning in a custom location.

Make sure to follow the setup process described here when configuring the components, since the steps are not always straightforward. We are considering ways to improve this process next year.