Hello Shunya,
For Q2, I don't believe there is a direct API call to do this but what you
can do is,
1. Push a data access filter for the IMU (either for the accelerometer,
gyro, or magnetometer) after constructing it. Ex: acc.PushFilter(sens
.ChFilterAccelAccess())
2. Then during the simulation loop, access the IMU data and publish them
into a CSV file. Here is an example of accessing and printing accelerometer
data,
while (ch_time < end_time):
# Access the sensor data
acc_data = acc.GetMostRecentAccelBuffer()
# Check data is present
# If so, print out the max value
if acc_data.HasData():
print("Accelerometer:",acc_data.GetAccelData().shape,"max:",np.
max(acc_data.GetAccelData()))
A full demo can be seen here:
https://github.com/projectchrono/chrono/blob/main/src/demos/python/sensor/demo_SEN_sensors.py
Let me know if there's anything else.
Best,
Nevindu M. Batagoda
On Friday, June 16, 2023 at 3:28:16 PM UTC-5 Shunya wrote:
*Dear all,*
I hava two questions about PyChrono's API.
Q1:Is it possible to record video of the simulation using PyChrono's API?
Q2: Is it possible to save IMU data to CSV using PyChrono's API?
Background of questions:
I am making the vehicle runnning model in PyChrono, referring to
"demo_MBS_tracks.cpp".
I would like to save the data from IMU to CSV in order to check the running
status.
And I would like to save the video of the nehicle running in the simulation.
Best regards,
--
You received this message because you are subscribed to the Google Groups
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/projectchrono/76732dc5-392d-47ea-87e7-f3fe6a554dc8n%40googlegroups.com.