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

Draw the projection of the center of gravity on the ground plane #80

Open
mithi opened this issue Apr 21, 2020 · 7 comments
Open

Draw the projection of the center of gravity on the ground plane #80

mithi opened this issue Apr 21, 2020 · 7 comments
Assignees
Labels
feature request New feature or request good first issue Good for newcomers low hanging fruit Probably easy to do

Comments

@mithi
Copy link
Owner

mithi commented Apr 21, 2020

You'd need to update the following
1. The model VirtualHexapod to have an attribute that stores this point

class VirtualHexapod:

You can compute this point as outlined by the algorithm here, you should inject the point calculation to a different function and update the attribute of the VirtualHexapod when this is called in the two compute_orientation_properties of the hexapod.ground_contact_solver module.

def is_stable(p1, p2, p3, tol=0.001):

2. In figure template, you should append a new point trace at the end of the data list

The trace has the following format

    {
        "marker": {"color": INSERT_COLOR_HERE, "opacity": 1.0, "size": INSERT_SIZE_HERE},
        "mode": "markers",
        "name": "cog-projection",
        "type": "scatter3d",
        "x": [INSERT_COG_X_HERE],
        "y": [INSERT_COG_Y_HERE,
        "z": [0],
    }

3. HexapodPlotter could draw this point in the figure template

def _draw_hexapod(fig, hexapod):

@mithi mithi added feature request New feature or request good first issue Good for newcomers low hanging fruit Probably easy to do labels Apr 21, 2020
@markkulube
Copy link
Contributor

@mithi This has been open for a couple months now.

Let me know when you think a "seasoned" contributor can take it on.....i would be interest!

@mithi
Copy link
Owner Author

mithi commented Jul 8, 2020

@mithi This has been open for a couple months now.

Let me know when you think a "seasoned" contributor can take it on.....i would be interest!

Sure go ahead, if you have some time to tinker around ... I I currently don't have time to explain things in detail but by inspecting the code I'm sure you'll be able to figure things out on your own... 😄

here's the new guide to contributing.

@markkulube
Copy link
Contributor

@mithi whaaatt? i like you detailed explanations, they get me thinking about clean code.

in all seriousness, thank you.

i only hope/expect can chime in when, and however you can.

so no pressure.

@markkulube
Copy link
Contributor

markkulube commented May 21, 2021

Hi @mithi. Apologies for the very very very long delay. I am finally done with school, can get back to OSS contributions, and I can start working on this issue before I start work again.

Though, I notice you re-implemented this project in JS. So do you still need this feature here?

@mithi
Copy link
Owner Author

mithi commented May 22, 2021

@markkulube

Hey! Long time no see 😄 This issue is open, so if you'd like to work on it, you're more than welcome 🙂

@markkulube
Copy link
Contributor

markkulube commented Jul 1, 2021

@mithi a couple short questions:

  1. What information is present in dimensions that I can use to initialize the point of projection for the self.projection_point attribute? The initial value is None or is it a Point/Vector as per points.py?
    class VirtualHexapod:
    def __init__(self, dimensions):
    self._store_attributes(dimensions)
    self._init_legs()
    self._init_local_frame()
    self.projection_point = None

  2. I understand calculation of the point is to be abstracted to it's own function e.g. compute_projection_point(---), but what are it's parameters? It would really help if there was a mathematical formula you had in mind thereby answering this question!

@mithi
Copy link
Owner Author

mithi commented Jul 3, 2021

@markkulube

VirtualHexapod has a property self.body which is a Hexagon

Hexagon has a property self.cog this is the center of gravity which is of type point Point

The projection of the center of gravity is just a point where the z coordinate is zero. IE

cogProjection.x = cog.x
cogProjection.y = cog.y
cogProjection.z = 0

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers low hanging fruit Probably easy to do
Projects
None yet
Development

No branches or pull requests

2 participants