Skip to content
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

Error of running Position Control #4

Open
ghost opened this issue Nov 8, 2018 · 8 comments
Open

Error of running Position Control #4

ghost opened this issue Nov 8, 2018 · 8 comments

Comments

@ghost
Copy link

ghost commented Nov 8, 2018

Hello,
I am trying to control our Baxter robot with HTC vive.

My baxter has a right electric gripper but does not have a left electric gripper (Instead left vacuum gripper).
So, I changed the launch file (https://github.com/h2r/ros_reality_bridge/blob/master/launch/ros_reality_bridge.launch) to not use the electric gripper on the left arm. Specifically, I deleted line 15.
After changing the launch file, I could run ros_reality_bridge.launch without problem.

But in Windows cmputer, when I run one scene (Position Control), some error occurs.

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.String].get_Item (System.String key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
TFListener.Update () (at Assets/Scripts/TFListener.cs:21)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

unity_error

Image from the right_hand_camera and the left_hand_camera is output on the VR space.
However, depth image and color image from kinect is not output on the VR space.

unity_game

Do you know what is the problem?

@dwhit
Copy link
Contributor

dwhit commented Nov 8, 2018

Is the robot's position updating correctly?

@ghost
Copy link
Author

ghost commented Nov 8, 2018

How should I check?
I’m sorry for the rudimentary question.

@dwhit
Copy link
Contributor

dwhit commented Nov 8, 2018

When the robot moves in real life, does it move in Unity?

@ghost
Copy link
Author

ghost commented Nov 9, 2018

Thank you for reply.
Yes, the robot moved in real life, it moved in Unity.

@ericrosenbrown
Copy link
Contributor

ericrosenbrown commented Nov 12, 2018

That's good. Can you confirm that the kinect is actually streaming data on the ROS side, such as in RViz? In addition, can you please confirm that the Kinect has a transform that can accessed relative to the robot base transform?

The error that you're getting in the Unity scene is that a specific key in the TFListener is not available, which is preventing something in the unity scene from being updated. Considering the robot is updating and not the kinect, I suspect it is the kinect, and that it's transform is not being streamed properly. Can you add a debug statement to line 21 of the TFListener (where the error is happening), and print out the name of the key so we can verify what transform is failing to be updated?

@ghost
Copy link
Author

ghost commented Nov 13, 2018

Thank you for reply.
I confirmed in RViz that the kinect is actually streaming data and has a transform that can accessed relative to the robot base transform.

screenshot from 2018-11-13 11-00-46

I'm sorry. Could you tell me how to print out the name of the key?

And does the fact that the left gripper transform ( l_grepper_l_finger , l_grepper_l_finger_tip , l_grepper_r_finger , l_grepper_r_finger_tip) does not exist affect? I am worried about it.

@ericrosenbrown
Copy link
Contributor

On line 20 of TFListener.cs in the scripts folder, right before line 21, can you add the line:
Debug.log(topic)
After you do this, run the unity scene and you should see a constant printout of strings. The error you are getting will still appear, but can you show us the print statements around the error so we can see which topic is causing the dictionary to fail a lookup? Specifically, what string is printing out right before you get that error? That's the ros topic that is failing.

I don't believe the fact that the left gripper transform is not showing matters, but this step will help us confirm that.

@ghost
Copy link
Author

ghost commented Nov 14, 2018

Thanks for the explanation.
I was relieved to hear that you don't believe the fact that the left gripper transform is not showing matters.

I added a debug statement to line 20 of TFListener.cs.
After running the unity scene, the results were displayed on the console.
unity_error_printout

On the ROS side, it says that the client has subscribed to ros_unity.
2018-11-14 2

I tried to check the contents of ros_unity by running rostopic echo.
2018-11-14 4

Do you know what is wrong from this result?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants