URoboSimEd - YousafRaja/URoboSim GitHub Wiki

This is the module for the newly added visual component of URoboSim which is found in the Editor Modes tab.

Enable UROSBridge

TODO: (Optional) Integrate UROSBridge with URoboSimEd and use this check box to control whether or not to connect to the server.

Enable Shape Collisions

With the pr2, almost every shape in the URDF was colliding with meshes so they had to be disabled. However there are simpler robots which are nothing but shapes. To support both types, this option was added. If enabled, the collision for shapes will not be ignored.

Enable AngularMotors

This will basically use UE4's angular motors to keep all joints in place. Disabling this leads to a rag-doll like actor. Note that by default the pr2's right shoulder joint has been slightly rotated up to give an example of how angular motors can be given a target rotation. Also note that this should be disabled if connecting to ROS since then the ROS controllers should be directing all the joint.

Enable Collision Tags

This will allow the parser to also use information from collision tags within the URDF. By default this had to be disabled since it was causing issues.

Collision Filter

The purpose of this is to select which links should have self-collisions disabled. Note that changes must be saved to take effect.

Any changes here will only be applied the next time a robot is dragged in from the Content Browser into the game-world.

Adding New Features to URoboSimEd

One might find it useful to change a variable at runtime that is not part of URoboSimEd. This is a quick tutorial on how new features can be added to URoboSimEd. I will show how the Enable Shape Collision check box was added.

  1. Added a new variable in URoboSimEd.h:

bool bEnableShapeCollisions = false;

  1. Copy/pasted one of the code blocks inside URoboSimEdModeToolkit. Note that the order of these code blocks determines the order in which they will appear in the editor. I needed a checkbox so I copied the code block for another checkbox that started like this:

    //Enable UROSBridge-----------------

  2. Changed the labels, descriptions and comments.

  3. Inside Locals, copied and pasted one of the existing functions. In this case, I needed a checkbox so I can start with SetUROSBridge.

static void SetUROSBridge(ECheckBoxState NewCheckedState) { if (IURoboSimEd::IsAvailableEd()) { FURoboSimEdModule& placeHolder = IURoboSimEd::GetEd(); placeHolder.bEnableUROSBridge = (NewCheckedState == ECheckBoxState::Checked) ? true : false; } }

  1. Changed the name and replaced placeHolder.bEnableUROSBridge. Now scroll down to the code block you copied/pasted earlier and make sure this function is called.

.OnCheckStateChanged_Static(&Locals::SetShapeCollision)

  1. We need this functionality inside RRobot.cpp which already has included the interface "IURoboSimEd.h" inside RRobot.h. To make use of it inside RRobot.cpp, we start by making a variable inside RRobot.h, we'll give it the identical name.

bool bEnableShapeCollisions;

  1. Now going into RRobot.cpp, in the constructor, we can initialize this value.

bEnableShapeCollisions = placeHolder.bEnableShapeCollisions;

  1. Now this value can be referenced anywhere inside RRobot.cpp.

if (!bEnableShapeCollisions) { ShapeComp->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore); }