-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added actors spawning with ROS2 param * added actors spawning with ROS2 param * removed an uneeded file for ROS2 params, ROS2SpawnableActor * fixed spawned robots pick drop crash * added copyright to ROS2Spawnable, removed emptiness check since doesnt seem useful at the moment * changed box back to using BP_AMRPayload * changed SetActorLabel to editor only and added use of Rename Co-authored-by: larryng-rapyuta <[email protected]>
- Loading branch information
1 parent
b2a5be4
commit acdb584
Showing
4 changed files
with
100 additions
and
10 deletions.
There are no files selected for viewing
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
Source/RapyutaSimulationPlugins/Private/Tools/ROS2Spawnable.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2020-2021 Rapyuta Robotics Co., Ltd. | ||
|
||
#include "Tools/ROS2Spawnable.h" | ||
|
||
// rclUE | ||
#include "Srvs/ROS2SpawnEntitySrv.h" | ||
|
||
void UROS2Spawnable::InitializeParameters(FROSSpawnEntity_Request Request) | ||
{ | ||
SetName(Request.state_name); | ||
SetNamespace(Request.robot_namespace); | ||
|
||
} | ||
|
||
void UROS2Spawnable::SetName(FString Name) | ||
{ | ||
ActorName = Name; | ||
} | ||
|
||
void UROS2Spawnable::SetNamespace(FString Namespace) | ||
{ | ||
ActorNamespace = Namespace; | ||
} | ||
|
||
FString UROS2Spawnable::GetName() | ||
{ | ||
return ActorName; | ||
} | ||
|
||
FString UROS2Spawnable::GetNamespace() | ||
{ | ||
return ActorNamespace; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Source/RapyutaSimulationPlugins/Public/Tools/ROS2Spawnable.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2020-2021 Rapyuta Robotics Co., Ltd. | ||
|
||
#pragma once | ||
#include "CoreMinimal.h" | ||
#include "GameFramework/Actor.h" | ||
|
||
// rclUE | ||
#include "Srvs/ROS2SpawnEntitySrv.h" | ||
|
||
#include "ROS2Spawnable.generated.h" | ||
|
||
UCLASS(ClassGroup = (Custom), Blueprintable, meta = (BlueprintSpawnableComponent)) | ||
class RAPYUTASIMULATIONPLUGINS_API UROS2Spawnable : public UActorComponent | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite) | ||
FString ActorName; | ||
|
||
UPROPERTY(EditAnywhere, BlueprintReadWrite) | ||
FString ActorNamespace; | ||
|
||
public: | ||
|
||
UFUNCTION(BlueprintCallable) | ||
virtual void InitializeParameters(FROSSpawnEntity_Request Request); | ||
|
||
UFUNCTION(BlueprintCallable) | ||
virtual void SetName(FString Name); | ||
|
||
UFUNCTION(BlueprintCallable) | ||
virtual void SetNamespace(FString Namespace); | ||
|
||
UFUNCTION(BlueprintCallable) | ||
virtual FString GetName(); | ||
|
||
UFUNCTION(BlueprintCallable) | ||
virtual FString GetNamespace(); | ||
|
||
}; |