- Get the latest update of MATLAB
- Save and close the model, then reopen the model. After reopening the model, use Ctrl+D to update the model
Header Assignment block error in ROS Toolbox: Header Assignment/Current Time' error occurred
31 views (last 30 days)
Show older comments
Hasan
on 22 Nov 2024 at 20:12
Commented: Hasan
on 23 Nov 2024 at 17:59
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.
0 Comments
Accepted Answer
Josh Chen
on 22 Nov 2024 at 21:42
Hello Hasan,
Thanks for bring this issue to our attention. This is a known bug caused by an internal infrastructure update. We are actively working on addressing this issue in future updates.
Before the update is available, can you try the following options and see if it works?
If none of these resolve the issue, would you be able to create some simple dummy model and share here so we can take a look on our end?
Thanks,
Josh
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!