I am trying to call a ROS service using a custom service message in simulink. I have successfuly followed the instruction here to load the custom message into Matlab. I need to do some string assignment in the message, I have been following the JointState publisher example to assaign the string array. The problem I am running into is I cannot figure out what the Bus type should be sent too. My message type is rbdl_server/RBDLInverseDynamicsRequest So I assigned the bus type: SL_Bus_sliding_controller_rbdl_server_RBDLInverseDynamicsRequest Which is causing the follow error: === Update Diagram (Elapsed: 1 sec) === Error:Expression 'SL_Bus_sliding_controller_rbdl_server_RBDLInverseDynamicsRequest' for type of data 'msg' did not evaluate to a valid type. Caused by: Invalid setting in 'sliding mode controller/MATLAB Function - String Array Assign1' for parameter 'Datatype' Error evaluating MATLAB Function parameter data 'Datatype' in its parent workspace. Unrecognized function or variable 'SL_Bus_sliding_controller_rbdl_server_RBDLInverseDynamicsReques'. Variable 'SL_Bus_sliding_controller_rbdl_server_RBDLInverseDynamicsReques' does not exist. what am I doing wrong? It seems like the message name is being truncated (missing the "t" at the end of the name) but I am not sure why that is happening or to fix that.
John Michell answered .
2025-11-20
whos SL_Bus_sliding_controller* % Output should look as follows: % Name Size Bytes Class Attributes % % SL_Bus_sliding_controller_RBDLInverseDynamicsReques_3qoi39 1x1 1890 Simulink.Bus % SL_Bus_sliding_controller_geometry_msgs_Point 1x1 220 Simulink.Bus % SL_Bus_sliding_controller_std_srvs_EmptyRequest 1x1 148 Simulink.Bus % SL_Bus_sliding_controller_std_srvs_EmptyResponse 1x1 150 Simulink.Bus
The service request bus name (if it followed the convention of model name appended by request message name) would have been longer than 63 character limit.
length('SL_Bus_sliding_controller_rbdl_server_RBDLInverseDynamicsRequest')