jrl-umi3218 / mc_openrtm

Interface between OpenRTM and mc_rtc
BSD 2-Clause "Simplified" License
3 stars 10 forks source link

Allow PD gains to be set through datastore call #23

Closed rohanpsingh closed 1 year ago

rohanpsingh commented 1 year ago

~[this is currently a draft which allows pd gains to be set only when the OutPorts are available (i.e. when using ModifiedServo)]~

This PR will create datastore functions to modify the servo PD gains, either directly on the iob if REAL_ROBOT = ON or through RTC ports if REAL_ROBOT = OFF.REAL_ROBOT is a cmake option.

The datastores can be called from an mc-rtc controller as follows:

rohanpsingh commented 1 year ago

Thanks for the review @gergondet I made most of the changes you requested with 2 remaining questions. I also added functionality to read/write gains by joint name.

I'd prefer this to be a run-time switch. We can easily detect if mc_openrtm is being run on a real robot (RobotHardware component is available) or in simulation

Is there an example for this? I'm not sure I know how to check for the RobotHardware component inside mc_openrtm

possible failure of IOB calls.

Should I check if each call returns a TRUE? And what to do if open_iob is successful but close_iob is not?

gergondet commented 1 year ago

Is there an example for this? I'm not sure I know how to check for the RobotHardware component inside mc_openrtm

I have implemented the member m_is_simulation in #25 you can rely on this to detect whether we are running in simulation or on hardware

Should I check if each call returns a TRUE? And what to do if open_iob is successful but close_iob is not?

To make the output readable:

rohanpsingh commented 1 year ago

Thanks @gergondet ! I implemented checks for possible IOB failure calls here https://github.com/jrl-umi3218/mc_openrtm/pull/23/commits/f531cc5e8ce46ed2d01a5882ac10983b4f3044ed. It looks dirty to me, so if you have a better suggestion, please let me know.

I am also using the m_is_simulation member now here https://github.com/jrl-umi3218/mc_openrtm/pull/23/commits/4d0cba07a7bdd9a9628f558dce9c75020afc7f0e.

gergondet commented 1 year ago

Thanks @rohanpsingh

Once the failed_iob issue is fixed and when this is tested on a robot we can merge.

rohanpsingh commented 1 year ago

Okay, I made the fix! If the CI passes, I'll find a way to test this safely on the real robot. :smiley:

rohanpsingh commented 1 year ago

I confirmed that I could change the gains on the real robot (with servo ON)