-
Notifications
You must be signed in to change notification settings - Fork 11
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
Movement Components refactor #19
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2530d90
Move components duplication refactored for RobotVehicle class and AMR…
praphulkallakuri 2b1cae5
Clang formatted code
praphulkallakuri 10feaae
Individual entity moved from io_amr_UE
praphulkallakuri c7df2d7
deleted files
praphulkallakuri 894de72
Moved StatePublisher class with minor changes
praphulkallakuri 685fed7
Add InversionFactor variable in RobotVehicleMovementComponent class, …
praphulkallakuri d1bc7c8
Updated with Identity,ZeroVector and OneVector functions
praphulkallakuri 3c354ab
[ATurtlebotBurger::InitializeMoveComponent()]
717d728
[RobotVehicle] Cleaning up
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
51 changes: 51 additions & 0 deletions
51
Source/RapyutaSimulationPlugins/Private/Tools/StatePublisher.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,51 @@ | ||
// Copyright 2020-2021 Rapyuta Robotics Co., Ltd. | ||
|
||
#include "Tools/StatePublisher.h" | ||
|
||
// rclUE | ||
#include "ROS2Node.h" | ||
|
||
// RapyutaSimulationPlugins | ||
#include "Tools/SimulationState.h" | ||
|
||
void UStatePublisher::RegisterPublisher(AROS2Node* Node) | ||
{ | ||
for (auto i = 0; i < StatesToPublish.Num(); i++) | ||
{ | ||
Node->AddPublisher(this); | ||
} | ||
} | ||
|
||
void UStatePublisher::PublishState(UROS2GenericMsg* Msg) | ||
{ | ||
UROS2EntityStateMsg* StateMsg = Cast<UROS2EntityStateMsg>(Msg); | ||
if ((StateMsg != nullptr) && StatesToPublish.IsValidIndex(Idx)) | ||
{ | ||
StateMsg->SetMsg(StatesToPublish[Idx]); | ||
Idx = (Idx + 1 == StatesToPublish.Num()) ? 0 : Idx + 1; // ue4 does not seem to have a modulo operator for integers | ||
// (it does have one for floats: FGenericPlatformMath::FMod) | ||
check(Idx < StatesToPublish.Num()); | ||
} | ||
} | ||
|
||
void UStatePublisher::Bind() | ||
{ | ||
UpdateDelegate.BindDynamic(this, &UStatePublisher::PublishState); | ||
} | ||
|
||
void UStatePublisher::AddEntityToPublish(const FString& InName, | ||
const FVector& InPosition, | ||
const FRotator& InOrientation, | ||
const FString& InRefFrame) | ||
{ | ||
FROSEntityState BodyState; | ||
BodyState.name = InName; | ||
BodyState.pose_position_x = InPosition.X; | ||
BodyState.pose_position_y = -InPosition.Y; | ||
BodyState.pose_position_z = InPosition.Z; | ||
BodyState.pose_orientation = InOrientation.Quaternion(); | ||
BodyState.pose_orientation.X = -BodyState.pose_orientation.X; | ||
BodyState.pose_orientation.Z = -BodyState.pose_orientation.Z; | ||
BodyState.reference_frame = InRefFrame; | ||
StatesToPublish.Add(BodyState); | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuokamoto not sure why AMRVehicle moves in a different style from TurtleBotBurger tho?
@praphulkallakuri And thus, based on the rationale, we might need a more specific name for
InversionFactor
I suppose.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need InversionFactor? Doesn't this cause issue in turtlebot3?