siemens / ros-sharp

ROS# is a set of open source software libraries and tools in C# for communicating with ROS from .NET applications, in particular Unity3D
Apache License 2.0
989 stars 373 forks source link

Various problems with the tutorial #47

Closed gris-martin closed 6 years ago

gris-martin commented 6 years ago

Not sure if this is a bug or just me, but I'm trying to follow the tutorial on the wiki. All of the tutorials starting with 1 worked fine, but I get into trouble when doing 2.1. I'm able to start the URDF Asset importer, and it looks like everything is importing fine when pressing the Read Robot Description. button, but...

  1. When it's done I'm getting a prompt saying Do you want to generate a null GameObject now? unity_nullobject
  2. The imported null GameObject looks like the TurtleBot, but the buttom (Kobuki) part is turned 90 degrees around the x axis, making it look like a wheel. unity_robot
  3. In the Unity console I get a few warnings of the type No Joint Component will be created in GameObject "camera_[xxx]_frame" as it has no Rigidbody Component. Please define an Inertial for Link "camera_depth_optical_frame" in the URDF file to create a Rigidbody Component.. Where [xxx] is rgb, rgb_optical, depth or depth_optical. unity_console
  4. When trying to import the .unity scene from step 2.2 (GazeboSimulationScene.unity) by doing File -> Open Scene, nothing happens. I found the scene in ros-sharp/Unity3D/Assets/RosSharp/Scenes/GazeboSimulationScene.unity since the latest Release (linked to in the tutorial) does not contain it.
  5. I tried doing the scene manually, as described in the same tutorial, and it seemed to work fine. But when starting the gazebo-simulation-scene on the Ubuntu VM I get the following error in the terminal: ERROR: cannot launch node of type [gazebo_simulation_scene/joy_to_twist.py]: can't locate node [joy_to_twist.py] in package [gazebo_simulation_scene], and the Gazebo main Window just remains black. I can start Gazebo normally and it seems to work fine.

Thanks in advance, this seems like a great product otherwise and I'm excited to get going :)

MartinBischoff commented 6 years ago

Hi @hassanbot thanks for getting started with ROS# and writing this issue.

Actually you posted 5 issues here. To simplify the discussion below and for future reference, please keep them separate next time.

Concerning 3: You can ignore these warnings. It would be problematic if these GameObjects had further child objects. This issue is addressed here.

Concerning the other issues: Likely you found some bugs which noone else has discovered yet as the latest changes and tutorials are relatively new. We will have a detailed look into it and answer them in the following days.

gris-martin commented 6 years ago

Yeah, you're right, maybe 1 and 2 should be same but the others are not related. Thanks for looking into it!

MartinBischoff commented 6 years ago

Concerning 4: The latest release ROS# Version 1.2a does contain the file GazeboSimulationScence.unity. It is packed in the file RosSharp.unitypackage

You can import the file as explained in the Wiki 1.1 1.1 Unity on Windows. Make sure that "All" files are selected before pressing "Ok".

The GazeboSimulationScene.unity file is identical to the file that you found here. Actually RosSharp.unitypackage contains all files in the Unity3D/Assets folder.

You reported that nothing happed. This is the case if the scene is already loaded. Probably you double clicked on it before.

Here is a screenshot of a blank Unity project into which I imported RosSharp.unitypackage and then opened GazeboSimulationScene. You see the GazeboSimulationScene file existing in the Assets and GameObjects loaded in this scene.

screenshot

gris-martin commented 6 years ago

Thanks, it worked! Sorry, I didn't realize that the GazeboSimulationScene was inside of the .unitypackage.

The turtlebot object doesn't seem to have any Visuals, though. I managed to add them manually, but I'm guessing this is not the intended workflow.

Regarding 5, Gazebo now starts fine, but I'm still not able to control the robot with the joystick (possbly due to the missing joy_to_twist.py node?). The joystick works in Unity with the ShadowHand tutorial, so I think the signals are received there correctly.

MartinBischoff commented 6 years ago

When reporting any news here, please refer to the number that you introduced above.

Summarizing for now, we have clarified your problems 3 and 4, correct?

We better ignore your statement about the missing Turtlebot Visuals since I can see them in the screenshot you posted above. Further this would be your issue number 6 in this issue. If this problem persits on your side, please write a separate issue with a clear desciption what you did, what you expected to happen, and what happened.

MartinBischoff commented 6 years ago

Concerning 1: In this commit we added a line in the publish_description_turtlebot2 launch file to set the robot/name parameter. Since this parameter was missing before, Unity did not know the robot's name and called it null. Please verify by doing Tutorial 2.1 with the updated launch file.

gris-martin commented 6 years ago

This is the status of the different topics:

  1. Solved with commit https://github.com/siemens/ros-sharp/commit/5aa660b3196be2c692e8d294fa4e23f2aaa37f0a (I've confirmed that it works)
  2. Not solved.
  3. Solved (was not really an issue in the first place).
  4. Solved, but I think that tutorial 2.2, section "Preparation" -> "Setting up the Unity scene: Linking URDF to ROS#" is a little ambiguous. Might be trivial to someone with more Unity experience, though.
  5. Not solved.

Regarding a 6th point about the turtlebot Visuals, they are visible when importing the robot through RosBridgeClient -> Import URDF Asset... but not when importing the scene from the Project tab under RosSharp -> Scenes -> GazeboSimulationScene. But I'll make a new issue about this.

gris-martin commented 6 years ago

Sorry, it's not really the Visuals missing, but the meshes. I created a separate issue: #49

gris-martin commented 6 years ago

5 was due to lacking execution permission. Running chmod +x joy_to_twist.py in the catkin_ws/src/gazebo_simulation_scene/scripts directory solved the issue.

Can permission changes be committed? Otherwise tutorial 2.2, "Setting up ROS" should mention that you need to change the permission.

MartinBischoff commented 6 years ago

Concerning 2: Recently the <up-axis> tag has been removed from Turtlebot 2 and Kobuki meshes. Here are the corresponding commits: turtlebot, kobuki.

With the hotfix committed here ROS# should be able to correctly import .dae files without an <up-axis> tag.

@hassanbot would you please verify this by doing Tutorial 2.1 with the updated ColladaAssetPostProcessor.cs?

MartinBischoff commented 6 years ago

Concerning 5: You are right, the execution permission was the reason why you could not launch the node. We updated the wiki Section 2.2 for joy_to_twist.py and Section 2.3 for `mouse_to_joy.py'.

gris-martin commented 6 years ago

Concerning 2: Yes, it now seems to be working correctly!

Concerning 5: Great!

I'm closing this issue now since all sub-issues have been solved. Thanks for all your help!!

hesamira commented 5 years ago

Hello every one, i have done all the steps based on the link "https://github.com/siemens/ros-sharp/wiki" but unfortunately I get freeze and errors when I run roslunch on my ubuntu and read robot description on my unity as the following picture. untitled