Hi there,
I have a problem I am trying to solve. It involues working out a "support" polygon for a humanoid robot in a software simulation (3D).
I am using the feet to work out the area that the feet cover. E,g second to last page of
ambarish.com/paper/goswami_kallem_ICRA2004.pdf
What would be the best way to do this in C++ mainly using vector3D's?
Many thanks for any help,
Peter
C++ Suport Polygon Vector Problem
Started by psnow85, Jun 17 2009 02:50 AM
6 replies to this topic
#1
Posted 17 June 2009 - 02:50 AM
|
|
|
#2
Posted 17 June 2009 - 07:33 AM
There is SO much infrastructure that has to exist before answering your question, that a simple answer is not possible. How are you storing vectors? How are you storing the model of the robot? How are you implementing the various calculations? etc.
Without knowing what you've done to model the robot up to this point, it isn't possible to offer meaningful advice.
Without knowing what you've done to model the robot up to this point, it isn't possible to offer meaningful advice.
#3
Posted 27 June 2009 - 01:30 AM
My bad, sorry for being vague.
To break it down I have the following:
4 Vector3D values. One of the top left & bottom left hand side of the left foot, and one on the top right & bottom right hand side of the right foot. Like shown below.
*__ __*
| | | |
| | | |
*__| |__*
What I need to do is create a polygon between the left foot (top left point) and the right foot (top right point) and the left foot(bottom left point) and right foot (bottom right point). This is in C++ (no classes)
Cheers for any pointers or help.
To break it down I have the following:
4 Vector3D values. One of the top left & bottom left hand side of the left foot, and one on the top right & bottom right hand side of the right foot. Like shown below.
*__ __*
| | | |
| | | |
*__| |__*
What I need to do is create a polygon between the left foot (top left point) and the right foot (top right point) and the left foot(bottom left point) and right foot (bottom right point). This is in C++ (no classes)
Cheers for any pointers or help.
#4
Posted 27 June 2009 - 01:04 PM
:001_huh:
Can't think of any reason why you would need to solve such a problem, nor the nature of the problem. How is your linear algebra? Looks to me like you don't know where to start, nor how to analyse the problem.
Can't think of any reason why you would need to solve such a problem, nor the nature of the problem. How is your linear algebra? Looks to me like you don't know where to start, nor how to analyse the problem.
#5
Posted 27 June 2009 - 01:08 PM
Mathematix said:
:001_huh:
Can't think of any reason why you would need to solve such a problem, nor the nature of the problem. How is your linear algebra? Looks to me like you don't know where to start, nor how to analyse the problem.
Can't think of any reason why you would need to solve such a problem, nor the nature of the problem. How is your linear algebra? Looks to me like you don't know where to start, nor how to analyse the problem.
Is this degree-level work? You should ask your tutor.
#6
Posted 27 June 2009 - 07:13 PM
Based on the PDF he referenced, it's a fairly basic introduction to 2D figure modeling and animation. However, there still isn't any code to show us concretely what you're doing to represent the robot in general.
#7
Posted 28 June 2009 - 04:15 AM
WingedPanther said:
Based on the PDF he referenced, it's a fairly basic introduction to 2D figure modeling and animation. However, there still isn't any code to show us concretely what you're doing to represent the robot in general.
Vector3D petersBehavior::ZRAMInsideSP()
{
Vector3D p1; //Top lefthand point of the left foot.
Vector3D p2; //Bottom lefthand point of the left foot.
Vector3D p3; //Top righthand point of the right foot.
Vector3D p4; //Bottom righthand point of the right foot.
int numberOfSides; //The number of sides the polygon has.
Vector3D LengP1toP2; //The Length of the side p1 to p2.
Vector3D LengP2toP3; //The Length of the side p2 to p3.
Vector3D LengP3toP4; //The Length of the side p3 to p4.
Vector3D LengP4toP1; //The Length of the side p4 to p1 (to complete the polygon).
Vector3D AreaOfSP; //The total area of the SP.
int PerimeterOfSP; //The perimeter of the SP.
AgentModel& am = SAgentModel::getInstance();
Localizer& loc = SLocalizer::getInstance();
Matrix4D localTransform = loc.getLocalTransformation();
numberOfSides = 4;
PerimeterOfSP = LengP1toP2 + LengP2toP3 + LengP3toP4 + LengP4toP1;
AreaOfSP = (numberOfSides * PerimeterOfSP) / 2;
}
This code doesn't state the exact vectors for each point but simply sets them up. Defining them would take place after the "numberOfSides = 4" definition.


Sign In
Create Account

Back to top









