Skip to content

Commit

Permalink
Mobile rack (#317) (#322)
Browse files Browse the repository at this point in the history
* add mobile rack

Co-authored-by: yuokamoto <[email protected]>
  • Loading branch information
github-actions[bot] and yuokamoto authored Nov 5, 2024
1 parent b08e511 commit bcaaaf8
Show file tree
Hide file tree
Showing 21 changed files with 298 additions and 91 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ Content/Robots/** filter=lfs diff=lfs merge=lfs -text
Content/SkeletalRobots/** filter=lfs diff=lfs merge=lfs -text
Content/Textures/** filter=lfs diff=lfs merge=lfs -text
Content/ExternalDevices/** filter=lfs diff=lfs merge=lfs -text
Content/Character/SKM_Manny_CtrlRig1.uasset filter=lfs diff=lfs merge=lfs -text
Content/Character/SKM_Manny_CtrlRig2.uasset filter=lfs diff=lfs merge=lfs -text
docs/source/_static/videos/** filter=lfs diff=lfs merge=lfs -text
4 changes: 2 additions & 2 deletions Content/ExternalDevices/BP_ConveyorCollisionMeshAddon.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/ExternalDevices/BP_ExternalDeviceBase.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/ExternalDevices/BP_MobileRack.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/ExternalDevices/BP_PayloadHandlerBase.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/ExternalDevices/BP_RackParam.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/ExternalDevices/BP_RackUnit.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/ExternalDevices/BP_SourceArea.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/ExternalDevices/BP_SplineConveyor.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/ExternalDevices/BP_VerticalConveyor.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/ExternalDevices/Legacy/BP_SimpleConveyor.uasset
Git LFS file not shown
Binary file modified Content/Tools/BP_PayloadBase.uasset
Binary file not shown.
Binary file modified Content/Tools/RRGeneralUtility.uasset
Binary file not shown.
Binary file modified Content/Tools/RRGeneralUtilityMacro.uasset
Binary file not shown.
35 changes: 35 additions & 0 deletions Source/RapyutaSimulationPlugins/Public/Core/RRConversionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class URRConversionUtils : public UBlueprintFunctionLibrary
return FVector(InLocation.X, -InLocation.Y, InLocation.Z);
}

UFUNCTION(BlueprintCallable, Category = "Conversion")
static FVector2D ConvertHandedness2D(const FVector2D& InLocation)
{
return FVector2D(InLocation.X, -InLocation.Y);
}

// UE: cm, ROS: m
template<typename T>
static T DistanceROSToUE(const T& InROSDistance)
Expand Down Expand Up @@ -77,6 +83,18 @@ class URRConversionUtils : public UBlueprintFunctionLibrary
OutputZ = InputZ * 0.01f;
}

UFUNCTION(BlueprintCallable, Category = "Conversion")
static FVector2D Vector2DUEToROS(const FVector2D& Input)
{
return 0.01f * ConvertHandedness2D(Input);
}

FORCEINLINE static void Vector2DUEToROS(const double& InputX, const double& InputY, double& OutputX, double& OutputY)
{
OutputX = InputX * 0.01f;
OutputY = -InputY * 0.01f;
}

/**
* @brief Convert UE Rotation to ROS Vector with optional Deg->Rad conversion
* @param Input
Expand Down Expand Up @@ -168,6 +186,23 @@ class URRConversionUtils : public UBlueprintFunctionLibrary
OutputZ = InputZ * 100.f;
}

UFUNCTION(BlueprintCallable, Category = "Conversion")
static FVector2D Vector2DROSToUE(const FVector2D& Input)
{
return 100.f * ConvertHandedness2D(Input);
}

FORCEINLINE static void Vector2DROSToUE(const FVector2D& Input, FVector2D& Output)
{
Output.Set(Input.X * 100.f, -Input.Y * 100.f);
}

FORCEINLINE static void Vector2DROSToUE(const double& InputX, const double& InputY, double& OutputX, double& OutputY)
{
OutputX = InputX * 100.f;
OutputY = -InputY * 100.f;
}

/**
* @brief Convert ROS Rotation Euler (rad) to UE Vector with optional Rad->Deg conversion
* @param Input
Expand Down
Binary file added docs/source/_static/videos/mobile_rack_demo.mp4
Binary file not shown.
Binary file added docs/source/_static/videos/mobile_rack_param.mp4
Binary file not shown.
Binary file not shown.
Binary file added docs/source/_static/videos/unit_rack_param.mp4
Binary file not shown.
Loading

0 comments on commit bcaaaf8

Please sign in to comment.