Skip to content

Latest commit

 

History

History
103 lines (71 loc) · 3.47 KB

File metadata and controls

103 lines (71 loc) · 3.47 KB

Assignment 02

Build your own robot model.

  • Build your own robot with a certain number n of links and n - 1 configurable joints.
  • Create a Configuration with certain values and the correct joint types.
  • Create a RobotModelArtist of your preference (e.g. compas_ghpython or compas_rhino)
  • Use the artist to update the robot with the created configuration (using its joint_dict), such that it configures into the letter of your choice (or any other identifiable figure).

How to start

Use the following code as a starting point for your assignment:

"""Assignment 02: Build your own robot model
"""
# Rhino
from compas_fab.robots import Configuration
from compas_rhino.artists import RobotModelArtist

from compas.datastructures import Mesh
from compas.geometry import Circle
from compas.geometry import Cylinder
from compas.geometry import Frame
from compas.geometry import Plane
from compas.geometry import Translation
from compas.robots import Joint
from compas.robots import RobotModel

# create cylinder in yz plane
radius, length = 0.3, 5
cylinder = Cylinder(Circle(Plane([0, 0, 0], [1, 0, 0]), radius), length)
cylinder.transform(Translation.from_vector([length / 2., 0, 0]))

# create robot
model = RobotModel("robot", links=[], joints=[])

# add links and joints to the robot model
# link0 = model.add_link(..)
# link1 = model.add_link(..)
# joint1 = model.add_joint(..)

# Create a configuration object matching the number of joints in your model
# configuration = ....

# Update the model using the artist
artist = RobotModelArtist(model)
# artist.update ...

# Render everything
artist.draw_visual()
artist.redraw()

Helpful links

Expected result

NOTE: It should be some recognizable shape, but not necessarily a letter M as in this image!

The result

How to submit your assignment

  1. You should have forked this repository last week, if not, check assignment submission of last week's lecture.

  2. Make sure your local clone is up to date

    (compas-fs2021) git checkout main
    (compas-fs2021) git pull origin
    
  3. Use a branch called assignment-02 for this week's assignment

    (compas-fs2021) git checkout -b assignment-02
    (compas-fs2021) git push -u assignments assignment-02
    
  4. Create a folder with your name and last name, eg. elvis_presley (make sure it is inside the current assignment folder)

  5. Create a Python file (eg. assignment_02.py) and paste the starting point code.

  6. Solve the coding assignment and commit

    (How do I commit?)

    Usually, commits are done from a visual client or VS code, but you can also commit your changes from the command line:

    (compas-fs2021) git add lecture_02/assignment_02/elvis_presley/\* && git commit -m "hello world"
    

  7. Once you're ready to submit, push the changes:

    (compas-fs2021) git push assignments
    
  8. And create a pull request (What's a pull request?)

    1. Open your browser and go to your fork
    2. Create the pull request clicking Compare & pull request and follow the instructions

    Start a pull request