-
Notifications
You must be signed in to change notification settings - Fork 13
Cable Robot Updates #331
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
Cable Robot Updates #331
Changes from all commits
eea92cc
14fe322
49f21c6
dffa704
4252df8
1b32c9d
b50166b
32ce160
a4aca11
decb82b
4f09d2a
7599c33
b9decde
10531d6
3d2c17a
b35f1f3
7d2c038
5113538
6bf0e85
ae12b38
66c58ec
c7fc779
e8f8929
5750d5f
7a11d03
c2ea56f
a1e6d4e
c27e258
9d45d7f
f40df13
acf2376
a7fcd2a
7499a7d
6d0ea28
822e27c
918daa7
8cb5045
2a551aa
340978f
761168e
72d13d0
9f8a0fe
1daaf24
77bfd05
7d19163
fa05de8
b1a9259
d618e65
45599ad
c1173fa
149501a
103f564
9b961b1
6c8233f
e0508f0
8879146
4c30d2c
23d2eda
8f46cef
08997a5
a44e6a1
dc709fc
2b0e523
d1bb841
d33f09e
cee41cc
a3ba8be
6a8665c
578610f
9595f96
a0122ab
d36c9bc
e2dc95d
d89c5e0
e9ba1b5
1d34bba
3353dc2
e480144
377241b
fe116a9
3c15854
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,4 +39,44 @@ class PriorFactor : gtsam::NonlinearFactor { | |
| const gtsam::KeyFormatter &keyFormatter); | ||
| }; | ||
|
|
||
| #include <gtdynamics/cablerobot/utils/CustomWrap.h> | ||
| gtsam::GaussianBayesNet* EliminateSequential(gtsam::GaussianFactorGraph graph, | ||
| const gtsam::Ordering &ordering); | ||
| gtsam::GaussianBayesNet* BlockEliminateSequential( | ||
| gtsam::GaussianFactorGraph graph, const gtdynamics::BlockOrdering &ordering); | ||
|
|
||
| // Tension Key Stuff | ||
| gtdynamics::DynamicsSymbol TensionKey(int j, int t = 0); | ||
|
|
||
| void InsertTension(gtsam::Values @values, int j, int t, double value); | ||
|
|
||
| void InsertTension(gtsam::Values @values, int j, double value); | ||
|
|
||
| double Tension(const gtsam::Values &values, int j, int t = 0); | ||
|
Comment on lines
+48
to
+55
|
||
|
|
||
| #include <gtdynamics/cablerobot/factors/WinchFactor.h> | ||
| class WinchParams { | ||
| double radius_; | ||
| double inertia_; | ||
| double staticFriction_; | ||
| double viscousFriction_; | ||
| WinchParams(double radius = 1, double inertia = 0, double staticFriction = 0, | ||
| double viscousFriction = 0); | ||
| }; | ||
| class WinchFactor : gtsam::NonlinearFactor { | ||
| WinchFactor(gtsam::Key torque, gtsam::Key tension, gtsam::Key cableVelocity, | ||
| gtsam::Key cableAcceleration, | ||
| const gtsam::noiseModel::Base *cost_model, gtdynamics::WinchParams params); | ||
| void print(const string &s, const gtsam::KeyFormatter &keyFormatter); | ||
| }; | ||
|
|
||
| #include <gtdynamics/cablerobot/factors/CableAccelerationFactor.h> | ||
| class CableAccelerationFactor : gtsam::NonlinearFactor { | ||
| CableAccelerationFactor(gtsam::Key ldot_key, gtsam::Key wTee_key, | ||
| gtsam::Key Vee_key, gtsam::Key VA_key, | ||
| const gtsam::noiseModel::Base *cost_model, | ||
| const gtsam::Point3 &wPb, const gtsam::Point3 &eePem); | ||
| void print(const string &s, const gtsam::KeyFormatter &keyFormatter); | ||
| }; | ||
|
|
||
| } // namespace gtdynamics | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |||||||||||||||||
| import gtsam | ||||||||||||||||||
| import gtdynamics as gtd | ||||||||||||||||||
| import numpy as np | ||||||||||||||||||
| from utils import MyLMParams | ||||||||||||||||||
|
|
||||||||||||||||||
| class CdprSimulator: | ||||||||||||||||||
| """Simulates a cable robot forward in time, given a robot, initial state, and controller. | ||||||||||||||||||
|
|
@@ -56,71 +57,86 @@ def __init__(self, cdpr, x0, controller, dt=0.01): | |||||||||||||||||
| self.reset() | ||||||||||||||||||
|
|
||||||||||||||||||
| @staticmethod | ||||||||||||||||||
| def update_kinematics(cdpr, fg, x, k): | ||||||||||||||||||
| """Runs IK to solve for the cable lengths and velocities at time step k | ||||||||||||||||||
| def update_kinematics(cdpr, x, k): | ||||||||||||||||||
| """Runs IK to solve for the cable lengths and velocities at time step k. | ||||||||||||||||||
|
|
||||||||||||||||||
| This method creates and returns a new ``gtsam.Values`` containing the solved | ||||||||||||||||||
| kinematic quantities and does not modify the input ``x`` in place. | ||||||||||||||||||
| Args: | ||||||||||||||||||
| fg (gtsam.NonlineaFactorGraph): any previous factors, if applicable | ||||||||||||||||||
| x (gtsam.Values): Values object containing the current Pose and current Twist, plus any | ||||||||||||||||||
| other values that may be needed (as initial guesses) for the `fg` argument. | ||||||||||||||||||
| x (gtsam.Values): Values object containing at least the current Pose and current Twist | ||||||||||||||||||
| k (int): current time step | ||||||||||||||||||
|
|
||||||||||||||||||
| Returns: | ||||||||||||||||||
| tuple(gtsam.NonlinearFactorGraph, gtsam.Values): the updated factor graph and values | ||||||||||||||||||
| tuple(gtsam.NonlinearFactorGraph, gtsam.Values): the factor graph used to perform IK | ||||||||||||||||||
| and the solution values which includes the current Pose, Twist, JointAngles, and | ||||||||||||||||||
| JointVels. | ||||||||||||||||||
| """ | ||||||||||||||||||
| fg = gtsam.NonlinearFactorGraph() | ||||||||||||||||||
| lid = cdpr.ee_id() | ||||||||||||||||||
| # local copy of values | ||||||||||||||||||
| xk = gtsam.Values() | ||||||||||||||||||
| gtd.InsertPose(xk, lid, k, gtd.Pose(x, lid, k)) | ||||||||||||||||||
| gtd.InsertTwist(xk, lid, k, gtd.Twist(x, lid, k)) | ||||||||||||||||||
| # IK for this time step, graph | ||||||||||||||||||
| fg.push_back(cdpr.kinematics_factors(ks=[k])) | ||||||||||||||||||
| fg.push_back( | ||||||||||||||||||
| cdpr.priors_ik(ks=[k], | ||||||||||||||||||
| Ts=[gtd.Pose(x, cdpr.ee_id(), k)], | ||||||||||||||||||
| Vs=[gtd.Twist(x, cdpr.ee_id(), k)])) | ||||||||||||||||||
| fg.push_back(cdpr.priors_ik(ks=[k], values=xk)) | ||||||||||||||||||
|
||||||||||||||||||
| fg.push_back(cdpr.priors_ik(ks=[k], values=xk)) | |
| fg.push_back( | |
| cdpr.priors_ik( | |
| ks=[k], | |
| Ts=[gtd.Pose(xk, lid, k)], | |
| Vs=[gtd.Twist(xk, lid, k)], | |
| ) | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't recall whether everything should be switched to (ks, Ts, Vs) or to values. May need a different agent to assess this in the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another PR where you use @yetongatech 's CmOpt. So maybe take a look at that and see what you decided on? I can try to have the AI bring that up to speed, but I would need your guidance on this particular priors_ik refactor.
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update_dynamics uses cdpr.priors_fd(ks=[k], values=u), but Cdpr.priors_fd in cdpr_planar.py currently accepts VAs (twist accelerations) and does not accept a values keyword argument. As written this will throw TypeError; adjust the call to match the existing API or update priors_fd to accept the intended input type.
| fg.push_back(cdpr.priors_fd(ks=[k], values=u)) | |
| fg.push_back(cdpr.priors_fd(ks=[k], VAs=u)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cdpr.params.winch_params is accessed here, but CdprParams in cdpr_planar.py does not define winch_params. This will raise AttributeError unless it is initialized elsewhere; either add winch_params to CdprParams.__init__ or guard/remove this access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be easy for an agent to fix. Might have been a merge conflict I made at some point.
Uh oh!
There was an error while loading. Please reload this page.