Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
master project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joschua Gosda
master project
Commits
0d013db7
Commit
0d013db7
authored
2 years ago
by
Joschua Gosda
Browse files
Options
Downloads
Patches
Plain Diff
pointer solution works :D
parent
903dce34
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Cleanup
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
c++/src/gpm.cpp
+9
-0
9 additions, 0 deletions
c++/src/gpm.cpp
c++/src/loadKinematicModel.cpp
+10
-0
10 additions, 0 deletions
c++/src/loadKinematicModel.cpp
python/taskspace_placement/computeJoints.py
+3
-3
3 additions, 3 deletions
python/taskspace_placement/computeJoints.py
with
22 additions
and
3 deletions
c++/src/gpm.cpp
+
9
−
0
View file @
0d013db7
...
...
@@ -16,11 +16,20 @@ Eigen::Matrix<double, 7, 1> &jointAngles, Eigen::Matrix<double, 7, 1> &jointVelo
// FORWARD KINEMATICS
rl
::
mdl
::
Kinematic
*
kinematic
=
(
rl
::
mdl
::
Kinematic
*
)
kinematic_ptr
;
std
::
cout
<<
"pointer in gpm"
<<
kinematic_ptr
<<
std
::
endl
;
//rl::mdl::Kinematic* kinematic = kinematicPtr;
/*
Eigen::Matrix<double, 7, 1> joint_anlges;
joint_anlges << 2.0, 1.0, 0.0, 2.0, 1.0, 0.0, 2.0;
// forward kinematics for the right arm
kinematic->setPosition(joint_anlges);
kinematic->forwardPosition();
kinematic->calculateJacobian();
std::cout << kinematic->getJacobian() << std::endl;
*/
kinematic
->
setPosition
(
jointAngles
);
kinematic
->
forwardPosition
();
kinematic
->
calculateJacobian
();
...
...
This diff is collapsed.
Click to expand it.
c++/src/loadKinematicModel.cpp
+
10
−
0
View file @
0d013db7
...
...
@@ -19,6 +19,16 @@ void * loadKinematicModel(std::string path) {
rl
::
mdl
::
Kinematic
*
my_pointer
=
&
model_kin
;
std
::
cout
<<
"pointer in func "
<<
my_pointer
<<
std
::
endl
;
/*
Eigen::Matrix<double, 7, 1> joint_anlges;
joint_anlges << 2.0, 1.0, 0.0, 2.0, 1.0, 0.0, 2.0;
// forward kinematics for the right arm
my_pointer->setPosition(joint_anlges);
my_pointer->forwardPosition();
my_pointer->calculateJacobian();
std::cout << my_pointer->getJacobian() << std::endl;
*/
return
(
void
*
)
my_pointer
;
//return kinematic;
}
This diff is collapsed.
Click to expand it.
python/taskspace_placement/computeJoints.py
+
3
−
3
View file @
0d013db7
...
...
@@ -34,7 +34,7 @@ computedPose_left = np.zeros((len(p1[:,0]),6))
error_left
=
np
.
zeros
((
len
(
p1
[:,
0
]),
6
))
kinematic_model_ptr_L
=
loadKinematicModel
(
"
/home/joschua/Coding/forceControl/master-project/c++/models/urdf/yumi_left.urdf
"
)
kinematic_model_ptr_R
=
loadKinematicModel
(
"
/home/joschua/Coding/forceControl/master-project/c++/models/urdf/yumi_right.urdf
"
)
#
kinematic_model_ptr_R = loadKinematicModel("/home/joschua/Coding/forceControl/master-project/c++/models/urdf/yumi_right.urdf")
# loop for the left arm
...
...
@@ -61,7 +61,7 @@ error_right = np.zeros((len(p1[:,0]),6))
jointAngles
=
np
.
array
([
-
110.0
,
29.85
,
35.92
,
49.91
,
117.0
,
123.0
,
-
117.0
])
*
np
.
pi
/
180.0
# loop for the right arm
for
index
,
(
pos
,
vel
,
phi
,
phi_dot
)
in
enumerate
(
zip
(
p2
,
v2
,
phi_delta
,
dphi
)):
# loop through all the desired position of left arm
"""
for index, (pos, vel, phi, phi_dot) in enumerate(zip(p2, v2, phi_delta, dphi)): # loop through all the desired position of left arm
desPose = np.concatenate((pos, phi), axis=0)
desVelocities = np.concatenate((vel, phi_dot), axis=0)
result = gpm(desPose, desVelocities, jointAngles, jointVelocities, kinematic_model_ptr_R)
...
...
@@ -71,7 +71,7 @@ for index, (pos, vel, phi, phi_dot) in enumerate(zip(p2, v2, phi_delta, dphi)):
jointVelocities = (desJointAngles_left[index, :] - desJointAngles_left[index-1, :])/dt
print(
'
\n
error
'
, desPose - result[1])
error_right[index, :] = desPose - result[1]
jointAngles
=
result
[
0
]
jointAngles = result[0]
"""
# see development of joint values
fig
=
plt
.
figure
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment