Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rover 2018 Model #369

Merged
merged 30 commits into from
Feb 23, 2019
Merged

Conversation

garethellis0
Copy link
Collaborator

Please fill out the following before requesting review on this PR

Description

  • revamped the sb_gazebo launch files
  • created a simple model for the 2018 rover

Testing Done

  • made sure things work in gazebo

Resolved Issues

Part of #344

Review Checklist

(Please check every item to indicate your code complies with it (by changing [ ]->[x]). This will hopefully save both you and the reviewer(s) a lot of time!)
It is the reviewers responsibility to also make sure every item here has been covered

  • Start of document comments: each .cpp and .h file should have a comment at the start of it. See files in src/sample_package for examples.
  • Function comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the classes defined in src/sample_package
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue
    Feel free to make additions of things that we should be checking to this file if you think there's something missing!!!!

@garethellis0 garethellis0 changed the title Gareth/rover 2018 model Rover 2018 Model Feb 9, 2019
@garethellis0
Copy link
Collaborator Author

Most of the "totally new" files are actually just moves. The only real "new" files are the rover_2018 ones.

Copy link
Collaborator

@RobynCastro RobynCastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks pretty good! Most of it is pretty readable, just have some documentation comments.

<xacro:macro name="cylinder_inertia" params="m r h">
<inertia ixx="${m*(3*r*r+h*h)/12}" ixy = "0" ixz = "0"
iyy="${m*(3*r*r+h*h)/12}" iyz = "0"
izz="${m*r*r/2}"
/>
</xacro:macro>

<!-- Calculate the intertia settings for a box with given mass, radius, height -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of mass, radius, height...should it be mass, and position?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to

<!-- Calculate the intertia settings for a box with given mass, x size, y size, z size -->

<xacro:macro name="box_inertia" params="m x y z">
<inertia ixx="${m*(y*y+z*z)/12}" ixy = "0" ixz = "0"
iyy="${m*(x*x+z*z)/12}" iyz = "0"
izz="${m*(x*x+z*z)/12}"
/>
</xacro:macro>

<!-- Calculate the intertia settings for a sphere with given mass, radius, height -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe height isn't included here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Changed to

<!-- Calculate the intertia settings for a sphere with given mass, radius -->

<xacro:property name="primary_rocker_radius" value="0.15"/>
<xacro:property name="primary_rocker_length" value="0.1"/>
<xacro:property name="primary_rocker_chassis_clearance" value="0.02"/>
<xacro:property name="primary_rocker_x_offset" value="0"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these offsets relative to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. So they're from the chassis. Not sure on the best way to doc. this, but added a comment above:

    <!-- Primary rocker offset from it's parent joint (the chassis) -->


<xacro:property name="primary_rocker_radius" value="0.15"/>
<xacro:property name="primary_rocker_length" value="0.1"/>
<xacro:property name="primary_rocker_chassis_clearance" value="0.02"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining what chassis clearance corresponds to here would be good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

    <!-- The size of the gap between the chassis and the primary rocker -->


<xacro:macro name="primary_rocker" params="lr_prefix y_reflect">
<!-- TODO: Make this revolute model with a spring to resist rotation (but allow it) instead of just being fixed like it currently is -->
<joint name="${lr_prefix}_primary_rocker_to_chassis" type="revolute">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining what lr_prefix means would be good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded all to left_right_prefix and added javadoc style comment to each macro.

material_name="grey"
/>
</xacro:macro>
<primary_rocker_arm lr_prefix="L" fb_prefix="FRONT" x_reflect="1" y_reflect="1"/>
Copy link
Collaborator

@RobynCastro RobynCastro Feb 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above comment, "not knowing what lr_prefix means" could also be addressed by expanding L to LEFT.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed L/R to left/right

Copy link
Collaborator

@RobynCastro RobynCastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more documentation comments.

<gazebo reference="camera">
<sensor type="depth" name="stereo_camera">
<always_on>1</always_on>
<update_rate>30.0</update_rate>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What units is update rate in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment indicating it is in Hz

</pointCloudTopicName>
<frameName>camera</frameName>
<pointCloudCutoff>0.5</pointCloudCutoff>
<distortionK1>0.00000001</distortionK1>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does distortion mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I'd never really looked into this too much before, but it's actually pretty cool. Changed to:

                <!-- 
                     For more info on the below coefficients, see 
                     https://www.mathworks.com/help/vision/ug/camera-calibration.html 
                -->
                <!-- 1st, 2nd, and 3rd order image distortion coefficients -->
                <distortionK1>0.00000001</distortionK1>
                <distortionK2>0.00000001</distortionK2>
                <distortionK3>0.00000001</distortionK3>
                <!-- X and Y translation -->
                <distortionT1>0.00000001</distortionT1>
                <distortionT2>0.00000001</distortionT2>

material_name="grey"
/>
</xacro:macro>
<primary_wheel lr_prefix="L" fb_prefix="FRONT" x_reflect="1" y_reflect="1"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, expanding to LEFT/RIGHT would make it easier to understand

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great point in general. There are a few things here that are not named verbosely enough.

Changed to left/right to be more consistent with our naming scheme (lower snake case).
Also changed lr_prefix->left_right_prefix, fb_prefix->front_back_prefix.

/>
</xacro:macro>
<primary_rocker_arm lr_prefix="L" fb_prefix="FRONT" x_reflect="1" y_reflect="1"/>
<primary_rocker_arm lr_prefix="R" fb_prefix="FRONT" x_reflect="1" y_reflect="-1"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is x_reflect and y_reflect a multiplier? A comment describing what the values mean would be good here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added javadoc style comments to each macro.

<primary_rocker lr_prefix="L" y_reflect="1"/>
<primary_rocker lr_prefix="R" y_reflect="-1"/>

<xacro:macro name="primary_rocker_arm" params="lr_prefix fb_prefix x_reflect y_reflect">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be helpful to have high-level comments describing what is happening in each xacro block. For example in this block, the arms are being connected to the rocker (I think).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might also be cleaner to put each of these blocks into their own xacro files, and include them back with xacro:include. That way we would have xacro file for each part, so we could easily change a specific part without having to search through this long file.

Copy link
Collaborator Author

@garethellis0 garethellis0 Feb 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After offline discussion, decided to leave the macros where they are.

Added javadoc style comments to each macro.

@garethellis0
Copy link
Collaborator Author

@RobynCastro - this should be good for another round of review!

Copy link
Collaborator

@RobynCastro RobynCastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for getting to the re-review late. But everything looks good to me now! Seems TravisCI is failing though on ALGLIB libraries. Once those are passing I can approve this PR.

Copy link
Collaborator

@RobynCastro RobynCastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@RobynCastro RobynCastro merged commit 0b61aa9 into UBC-Snowbots:master Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants