-
Notifications
You must be signed in to change notification settings - Fork 26
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
WIP: [core] Add transmission abstraction. #432
base: master
Are you sure you want to change the base?
Conversation
7117ab5
to
614e7cc
Compare
Todo:
|
614e7cc
to
de6a9b5
Compare
de6a9b5
to
3047673
Compare
a9a2c74
to
225724e
Compare
225724e
to
52aae4e
Compare
bool_t isAttached_; ///< Flag to determine whether the motor is attached to a robot | ||
std::weak_ptr<Robot const> robot_; ///< Robot for which the command and internal dynamics | ||
std::function<hresult_t(AbstractMotorBase &)> notifyRobot_; ///< Notify the robot that the configuration of the sensors have changed | ||
std::function<hresult_t(AbstractMotorBase &)> notifyRobot_; ///< Notify the robot that the configuration of the motors have changed |
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.
ed03d33
to
500b569
Compare
I fixed the way how to access the robot, but it does not have a member model. I'm a bit lost how to get access to the model at this point.. |
it is |
I still have sharedHolders all over the place in the AbstractTransmission. We agreed that we do not need this for them right ? So I will get rid of them |
yes, there is no shared memory for them. since nobody wants to access the state of all the transmissions at once. It is only the case for the motors and sensors, and system state. |
maybe you can explain me quickly what do you mean exactly with this "copy on purpose". I tried to do it in a same way then AbstractMotor.h |
why in this case you propose to do whereas the other getters have |
why you think we shouold q and v in this case? I thought the simple transmission is just a basic reduction ratio that is state independent |
The point is to write "copy on purpose" when you do a copy on purpose. In your example |
You can have a look at the definition of
|
Yes indeed, but you never comment variable names in declaration. Only in definitions. |
/home/fabian.schramm/wdc_workspace/src/jiminy/core/src/engine/EngineMultiRobot.cc: In member function ‘const vectorN_t& jiminy::EngineMultiRobot::computeAcceleration(jiminy::systemHolder_t&, jiminy::syst
emDataHolder_t&, const vectorN_t&, const vectorN_t&, const vectorN_t&, jiminy::forceVector_t&)’:
/home/fabian.schramm/wdc_workspace/src/jiminy/core/src/engine/EngineMultiRobot.cc:3690:14: error: ‘pinocchio::Data’ {aka ‘struct pinocchio::DataTpl<double>’} has no member named ‘rotorInertia’
3690 | data.rotorInertia = system.robot->getArmatures();
| ^~~~~~~~~~~~ I think this is quite werid as I did not modify something related to pinocchio:Data (that's why I had a comment with wtf before) |
It is expected. it should be |
47b72b9
to
2b5dc0d
Compare
I was think, and there is still an issue with the API of the transmission. It is not possible to define a transmission only by its transform matrix (jacobian) because it only applies on spatial motion and force vectors (velocity and upward) but not on the configuration. For this, you should provided another methods, converting back and forth configuration vectors from joint space to motor space. There is no other choice to be generic. |
After doing the math, I realized you should remove the acceleration from motor state, and from transmission forward/backward. It is more tricky to handle acceleration (it requires any additional user specified matrix) and not necessary in practice in 99% of the usecases. |
You should also limit yourself to invertible transmissions,. Which are n-to-n motor to joint mappings. And rename the abstract case accordingly. Non-invertible transmission must be modelled through constraints instead. |
It is necessary to access the motors directly at robot level for several reasons, including the calling the *All methods of motors (such as resetAll ), which cannot be done at transmission level since there is no sharedHolder for them. So I suggest still dealing with the motor directly at robot level, instead of doing it through the transmission as we suggested. Similarly, I tend to think it may be better to remove again notifyRobot, and just create and return the list when the getter is called (no longer returning an attribute but a temporary). For me using notifyRobot is too much of a hassle just to provide a convenience getter. Also, you should add a reset method to the transmission, and reset them alongside the motors. |
Cassie could be the first robot using an advanced transmission in Jiminy. Currently it is done by solving a optimization problem, which is likely to be more costly. Could be interesting to compare both. Transmission should be unbeatable. Ideally we should also implement joint spring. So we could compare the "exact" model with the simplified one with linearized transmission. |
|
bc0276f
to
2d753b8
Compare
start modifying
AbstractMotor
andBasicMotors
, add initial files for transmission