SNRLab / SlicerROSIntegrationTraining

Create a plugin software to connect ROS and Slicer by OpenIGTLink
1 stars 0 forks source link

Extend TrackerServer2.cxx and ReceiverServer.cxx example for OpenIGTLink to accommodate them to ROS #13

Closed ayamada0614 closed 11 years ago

jamesmith commented 11 years ago

I read OpenIGTLinkPluginForROS.cpp, but there are some points that I cannot understand.

  1. There are two controllers, but each role?
  2. I think that _targetposition is fixed with the following source code. line 116 - 117 in OpenIGTLinkPluginForROS.cpp.

    this->target_position_[0] = 3.14*10.0/180.0;
    this->target_position_[1] = 3.14*20.0/180.0;
ayamada0614 commented 11 years ago
  1. It was come from a special robot design. Don't mind, you can erase one of them.
  2. Yes, the target positions in the skeleton code is fixed so far. Your task is to implement OpenIGTLink in this package to make them variables and control them.
ayamada0614 commented 11 years ago

Please use transform as a message type for connecting Slicer and ROS.

jamesmith commented 11 years ago

Please tell me the method to transmit a message from Slicer. I have been for only the receiving in Slicer.

jamesmith commented 11 years ago

Did this repository change a private?

ayamada0614 commented 11 years ago

You can see how to use OpenIGTLink module to send transformation matrix from Slicer to IGT device and your own software from http://www.slicer.org/slicerWiki/index.php/Slicer_3.6:Training

Please see OpenIGTLink tutorial.

jamesmith commented 11 years ago

OpenIGTLInk tutorial is shown in only the receiving. ( Slicer <- Tracker Client )

jamesmith commented 11 years ago

Is it TrackerServer.cxx not TrackerServer2.cxx to use Transform massage ?

Is the allotment of Joint angle to Transform massage all right in follows?

igtl::Matrix4x4& matrix
float orientation[4];

orientation[0]=base_angle;
orientation[1]=joint1_angle;
orientation[2]=joint2_angle;
orientation[3]=joint3_angle;

//igtl::Matrix4x4 matrix;
igtl::QuaternionToMatrix(orientation, matrix);
ayamada0614 commented 11 years ago

You can use TrackerServer.cxx and TrackerServer2.cxx. There is no limitation. You should use elements (0,3), (1,3) and (2,3) to send target angles for each joint.

jamesmith commented 11 years ago

I made SimpleSenderClient first of all. It can send a joint angles from the terminal.

example :

$ ./SimpleSenderClient 127.0.0.1 18944
Input angle [joint1,joint2,joint3] > 10, 20, 30
Sent Transform.
=============
0, 0, 0, 10
0, 0, 0, 20
0, 0, 0, 30
0, 0, 0, 1
=============
Input angle [joint1,joint2,joint3] >
ayamada0614 commented 11 years ago

Good!

jamesmith commented 11 years ago

It is the confirmation of the method of rosmake including OpenIGTLink. Is it right in the following procedure?

step.1

Insert the following text to CMakeLists.txt

find_package(OpenIGTLink REQUIRED)
include(${OpenIGTLink_USE_FILE})

step.2

execute following command in SlicerROSIntegrationTraining/build.

$ ccmake ../

step.3

execute following command in _ROSWORKSPACE.

$ rosmake SlicerROSIntegrationTraining
ayamada0614 commented 11 years ago

Were you able to execute make command without errors following the procedure you mentioned?

ayamada0614 commented 11 years ago

You should insert a line as follows:

target_link_libraries(OpenIGTLinkPluginForROS OpenIGTLink)

jamesmith commented 11 years ago

I succeeded in rosmake by received advice.

jamesmith commented 11 years ago

I add a reception function of target position by OpenIGTLink. I push the changed code. Please check my code.

But, I have not yet added the transmission function.

ayamada0614 commented 11 years ago

Please keep updating the code.

jamesmith commented 11 years ago

I add a send function of joint angles by OpenIGTLink. and, I confirmed that I could receive joint angles in Slicer.

Please check my code.