Building a controller to move the beam #4733
-
Hello, I see the InterventionalRadiologyController which I use to automatically move my designed catheter in a certain direction. I wanted to know if it was possible to design a controller which took inputs through a CAN Bus and translate it to SOFA. If this is possible, which states of the object do I have to change with respect to the controller? Please let me know if there is a thread based on the question as well. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hi @Slykkey , I don't know what is CAN Bus but if you can communicate with it directly in c++. I would recommend to write a new controller similar to this one: https://github.com/sofa-framework/BeamAdapter/blob/4f0f30c7025740e808865d392c1bac7df3627e9b/src/BeamAdapter/component/controller/BeamAdapterActionController.inl#L70 ++Erik |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
@Slykkey ,
So I see several options to do what you want:
BeamAdapterActionController
handle a list of BeamAdapterAction. It has been designed to export and replay actions but you can use it on the fly. If you put it ind_writeMode
= False, at each new timestep it will check if an action need to be send to theInterventialRadiologyController
at this timestep. See this method. So you can add a pythonScriptController to update the list of d_timeSteps and d_actions. I'm just not 100% sure you won't have a delay of 1 timestep, because I don't know which will be first executed between the pythonScriptController and theBeamAdapterActionController
BeamAdapterActionController
…