Skip to content

Commit

Permalink
update RVIZNPCSpawner.cs
Browse files Browse the repository at this point in the history
Signed-off-by: Alptuğ Cırıt <[email protected]>
  • Loading branch information
mozhoku committed Sep 26, 2024
1 parent cc069f8 commit 49907ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Assets/AWSIM/Scripts/NPCs/RvizNPCSpawner/RVIZNPCSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public class RVIZNPCSpawner : MonoBehaviour
private float _raycastStart = 1.33f;

// Subscriber
ISubscription<dummy_perception_publisher.msg.Object> dummyPerceptionSubscriber;
ISubscription<tier4_simulation_msgs.msg.DummyObject> dummyPerceptionSubscriber;

void Start()
{
// Initialize the ROS2 node and create the subscription
dummyPerceptionSubscriber
= SimulatorROS2Node.CreateSubscription<dummy_perception_publisher.msg.Object>(
= SimulatorROS2Node.CreateSubscription<tier4_simulation_msgs.msg.DummyObject>(
dummyPerceptionTopic, OnObjectInfoReceived, qosSettings.GetQoSProfile());
}

Expand Down Expand Up @@ -100,7 +100,7 @@ private void FixedUpdate()
/// Callback method to handle incoming ROS messages
/// </summary>
/// <param name="msg">Received Object message</param>
void OnObjectInfoReceived(dummy_perception_publisher.msg.Object msg)
void OnObjectInfoReceived(tier4_simulation_msgs.msg.DummyObject msg)
{
_npcLabel = msg.Classification.Label; // Label: 0 = delete All Npcs, 7 = Spawn pedestrians, 3 = spawn vehicle
_interactiveAction = msg.Action; // Action: 0 = uninteractive mode, 1 = interactive mode, 2 = delete interactive NPCs
Expand Down Expand Up @@ -321,7 +321,7 @@ private void DespawnInteractiveNPCs()
/// </summary>
void OnDestroy()
{
SimulatorROS2Node.RemoveSubscription<dummy_perception_publisher.msg.Object>(dummyPerceptionSubscriber);
SimulatorROS2Node.RemoveSubscription<tier4_simulation_msgs.msg.DummyObject>(dummyPerceptionSubscriber);
}
}
}

0 comments on commit 49907ae

Please sign in to comment.