problems of baxter_cor​e_msgs/Joi​ntCommand in simulink

2 ビュー (過去 30 日間)
peidong
peidong 2015 年 7 月 1 日
回答済み: Darsana Thulasi 2015 年 7 月 9 日
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 Center および File ExchangeNetwork Connection and Exploration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by