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

A03 karen antorveza #57

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lecture_03/202_visualize_model_with_meshes_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from compas.robots import LocalPackageMeshLoader
from compas.robots import RobotModel

model = RobotModel.from_urdf_file("models/05_origins_meshes.urdf")
model = RobotModel.from_urdf_file("models/04_visual_origins.urdf")

loader = LocalPackageMeshLoader("models", "basic")
model.load_geometry(loader)
Expand Down
785 changes: 735 additions & 50 deletions lecture_03/207_robot_artist_grasshopper.ghx

Large diffs are not rendered by default.

26 changes: 17 additions & 9 deletions lecture_03/210_build_your_own_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from compas.robots import Joint
from compas.robots import RobotModel

# create cylinder in yz plane
# create cylinder in yz plane (we will use this for everything)
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, 0]))
Expand All @@ -22,26 +22,34 @@
mesh2 = Mesh.from_shape(cylinder)

# add links
link0 = model.add_link("world")
link0 = model.add_link("world") #this one doesn't have geometry
link1 = model.add_link("link1", visual_mesh=mesh1, visual_color=(0.2, 0.5, 0.6))
link2 = model.add_link("link2", visual_mesh=mesh2, visual_color=(0.5, 0.6, 0.2))

# add joints between the links
# add joints between the links where it moves (link0 child, link1 parent)
axis = (0, 0, 1)

origin = Frame.worldXY()
model.add_joint("joint1", Joint.CONTINUOUS, link0, link1, origin, axis)
origin1 = Frame.worldXY()
model.add_joint("joint1", Joint.CONTINUOUS, link0, link1, origin1, axis)

origin = Frame((length, 0, 0), (1, 0, 0), (0, 1, 0))
model.add_joint("joint2", Joint.CONTINUOUS, link1, link2, origin, axis)
origin2 = Frame((length, 0, 0), (1, 0, 0), (0, 1, 0))
model.add_joint("joint2", Joint.CONTINUOUS, link1, link2, origin2, axis)

# Create a configuration object matching the number of joints in your model
# configuration = ....
configuration = model.zero_configuration() #close to all zeros
configuration.joint_values =[2, 1.57]

# Update the model using the artist
artist = Artist(model)
# artist.update ...
artist.update(configuration)

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


artist1 = Artist(frame)
artist2 = Artist(model)
artist2.update(config)

a = [artist.draw()]
Binary file added lecture_03/assignment_02/02-assignment.gh
Binary file not shown.
Binary file added lecture_03/assignment_02/hanging man_SCKA.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lecture_03/assignment_02/hanging_man.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lecture_04/306_robot_from_ros_artist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
z # Before running this example, make sure to run
# Before running this example, make sure to run
# "docker compose up" on the docker/gofa-noetic folder
from compas.artists import Artist
from compas_fab.backends import RosClient
Expand Down
5,751 changes: 5,751 additions & 0 deletions lecture_04/assignment_03/assignment_03.ghx

Large diffs are not rendered by default.

5,718 changes: 5,718 additions & 0 deletions lecture_04/assignment_03/karen-antorveza/assignment_03.ghx

Large diffs are not rendered by default.