Closed mitsudome-r closed 3 months ago
I'm getting this message when I listen to the /simulation/dummy_perception_publisher/object_info, here the position is around 81000 & 49000 for x and y whenever I create a dummy NPC in rviz.
initial_state:
pose_covariance:
pose:
position:
x: 81383.5859375
y: 49919.77734375
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.2974268081526713
w: 0.95474462229023
@SujayAmberkar you can check out this.
I'm not sure if it does anything else with the coordinate values.
Message should be added as a custom message:
@mozhoku I want to create a new custom message but I'm unsure if it'll cause any problems. And you're working on an issue of replacing older messages with new ones so I wanted to know what I should take care of while creating a new custom message. By reading that issue I could only understand that it's something related to the change of names.
@SujayAmberkar if you are adding a new custom message it shouldn't affect anything. I will be replacing the current message types used by the simulation so that it can communicate with the main autoware_universe branch after the msg changes.
For example: autoware_auto_perception_msgs
=> autoware_perception_msg
.
@SujayAmberkar do you have any updates on this feature? We would like to speed up this feature's development, it is important for the planning team.
@xmfcx Hello, extremely sorry for the delay. I'll finish this as soon as possible. I'm facing a problem here. I cannot access the position inside the message after adding a custom message in Unity and writing the following code.
initial_state:
pose_covariance:
pose:
position:
x: 81383.5859375
y: 49919.77734375
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.2974268081526713
w: 0.95474462229023
public class RVIZNPCSpawner : MonoBehaviour
{
[SerializeField] string NPCSpawnerTopic = "/simulation/dummy_perception_publisher/object_info";
// Subscriber
ISubscription<dummy_perception_publisher.msg.Object> NPCSpawnerSubscriber;
void Start()
{
// Define default QoS settings
QoSSettings qosSettings = new QoSSettings();
// Initialize the ROS2 node and create the subscription
NPCSpawnerSubscriber = SimulatorROS2Node.CreateSubscription<dummy_perception_publisher.msg.Object>(
NPCSpawnerTopic, NPCSpawnerCallback, qosSettings.GetQoSProfile());
}
/// <summary>
/// Callback method to handle incoming messages
/// </summary>
/// <param name="msg">Received Object message</param>
void NPCSpawnerCallback(dummy_perception_publisher.msg.Object msg)
{
Debug.Log(msg.initial_state.pose_covariance.pose.position.x); }
void OnDestroy()
{
// Clean up the subscription when the GameObject is destroyed
SimulatorROS2Node.RemoveSubscription<dummy_perception_publisher.msg.Object>(NPCSpawnerSubscriber);
}
}
I get this error, error CS1061: 'Object' does not contain a definition for 'initial_state' and no accessible extension method 'initial_state' accepting a first argument of type 'Object' could be found (are you missing a using directive or an assembly reference?)
Solved the problem in the previous comment. Here's a video demo of the work so far, NPC Vehicles and Pedestrians are spawned properly but vehicles do not move. https://www.youtube.com/watch?v=eyjrpyz1Mq8
@xmfcx I've added a feature to make the vehicle move in its forward direction once it's spawned. But here's the problem, since we want to remove the rigid body component the vehicle goes into the ground after moving some distance maybe because the ground is not levelled. Is there a reason for removing the rigid body? Initial pose:
After some time:
Why remove the rigid body? I've suggested removing the colliders. Or colliders could have their layers set accordingly https://docs.unity3d.com/Manual/LayerBasedCollision.html
Ahh ok, my bad. I got confused.
Features Added:
https://github.com/user-attachments/assets/79b67a5c-9c50-4333-8237-658994f09ae8
Here is the draft PR https://github.com/autowarefoundation/AWSIM-Labs/pull/118
Description
We could add a feature to AWSIM to receive a dummy perception message from RVIZ to spawn an NPC vehicle at user's demands just like in this tutorial: https://autowarefoundation.github.io/autoware-documentation/main/tutorials/ad-hoc-simulation/planning-simulation/#placing-dummy-objects