problems of baxter_cor​e_msgs/Joi​ntCommand in simulink

4 次查看(过去 30 天)
Hi All,
I tried to control baxter robot using simulink, but I find there may be some problem of creating topic. 1, there is no names(data type, string[]) for baxter_core_msgs/JointCommand; 2, the Msg.command input port requires 128X1 elements of array, while actually we only need 7X1 array to publish the topic e.g. '/robot/limb/left/joint_command'. what's the 128X1 elements of array composed of? it works in matlab manuscripts,as follows, pub=rospublisher('/robot/limb/left/joint_command','baxter_core_msgs/JointCommand'); Msg=rosmessage('baxter_core_msgs/JointCommand');
command=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];% here we can see it's 7X1, not 128X1 declared in simulink. names=[{'left_w0'}, {'left_w1'}, {'left_w2'}, {'left_e0'}, {'left_e1'}, {'left_s0'}, {'left_s1'}]; mode=1; Msg.Command=int64(command);
Msg.Mode=int32(1); Msg.Names=(names); send(pub,Msg); Looking forward to your answers! Thanks,
John

回答(1 个)

Darsana Thulasi
Darsana Thulasi 2015-7-9
128X1 is the default size. You can change this by going to Tools>>Robot Operating System and set the value in Manage Size Arrays. Please see this doc link for more information: http://www.mathworks.com/help/robotics/ug/manage-array-sizes-in-simulink-ros.html

类别

Help CenterFile Exchange 中查找有关 Network Connection and Exploration 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by