Header Assignment block error in ROS Toolbox: Header Assignment/Current Time' error occurred
Mostrar comentarios más antiguos
I'm currently setting up a UAV simulation with a LiDAR and an RGB camera. My 3d animation scene is perfectly running and simulating. Now, I want to take some of the lidar data and camera data, and publish it over ROS (not ROS2), to a specific topic. I've registered my customMsg structure, which is:
std_msgs/Header header
uint32 seq
time stamp
string frame_id
uint64 timebase
uint32 point_num
uint8 lidar_id
uint8[3] rsvd
livox_ros_driver/CustomPoint[] points
uint32 offset_time
float32 x
float32 y
float32 z
uint8 reflectivity
uint8 tag
uint8 line
The Simulink model diagram should help understanding the setup.

The MATLAB function simply populates the Points array, and then outputs it to the Points field in the bus assignment block. The blank message has the above mentioned structure. In header assignment, i checked set timestamp, and i set the frame_id as camera_init, which is what I found from a bag file of data, which I'm essentially attempting to replicate. The topic is /livox/lidar, and I simply want to publish my data there, or just generally test it.
Now that i've given enough context (better safe than sorry), the error occurs in the header assignment block. The error is:
MATLAB System block 'UAV_LIDAR_HASAN_TEST/Header Assignment/Current Time' error occurred when invoking 'getOutputDataTypeImpl' method of 'ros.slros.internal.block.CurrentTime'. The error was thrown from '
'/usr/local/MATLAB/R2024b/toolbox/ros/utilities/+ros/+slros/+internal/+bus/Util.m' at line 307
'/usr/local/MATLAB/R2024b/toolbox/ros/utilities/+ros/+slros/+internal/+block/CurrentTime.m' at line 286
'/usr/local/MATLAB/R2024b/toolbox/ros/utilities/+ros/+slros/+internal/+block/CurrentTime.m' at line 215
'/usr/local/MATLAB/R2024b/toolbox/simulink/ui/studio/config/m/+SLStudio/StartPauseContinue.p' at line 0
'/usr/local/MATLAB/R2024b/toolbox/simulink/ui/studio/config/m/+SLStudio/ToolBars.p' at line 0'.
Caused by:
Invalid Simulink object name: 'untitled'.
The block diagram 'untitled' is not loaded
I've tried restarting MATLAB and Simulink. I always use rosinit and generally can't seem to find why this error is occuring. I can't open the header block subsystem as well as it says hidden? I may be wrong here, just can't understand the cause. I see error is with the Current Time block, and that the block diagram "untitled" is not loaded, but it makes no sense to me. I know the Current Time block should get the ros system time, so i don't know if maybe its unable to get it. My model itself is saved, and there's no unconnected blocks or ports.
This issue is currently also occuring in the default "ros/RosHeaderAssignmentBlockExample", as well as in my own simulation. So I figure it has to be some sort of global issue?
Can anyone help? Am I missing something really basic? Sorry if the issue's really small. My environment is Ubuntu 20.04, and Ros Noetic.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre ROS Network Access in Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!