フィルターのクリア

Open and Close Baxter's gripper

5 ビュー (過去 30 日間)
Haoying  Kang
Haoying Kang 2017 年 3 月 16 日
コメント済み: snow John 2018 年 11 月 26 日
Hi, we are trying to make our baxter robot open and close its gripper, we are using the following code that we generate from mathwork tutorial, but is not working, so can you please help?
rosinit('169.254.9.127') % ip address of baxter
rostopic info /robot/end_effector/right_gripper/command
pub = rospublisher('/robot/end_effector/right_gripper/command')
msg = rosmessage('baxter_core_msgs/EndEffectorCommand')
showdetails(msg)
msg.Id=65538
msg.Command= 'grip'
msg.Sender= 'foo'
msg.Sequence= 1
send(pub,msg)% nothing happens
msg.Command= 'release'
send(pub,msg) %nothing happens again
rosshutdown

採用された回答

Benjamin Brandwin
Benjamin Brandwin 2017 年 4 月 25 日
編集済み: Benjamin Brandwin 2017 年 4 月 25 日
I had the same problem. After some searching I managed to figure it out. The way to do this is through the script gripper_action_server.py
Use rosrun baxter_interface gripper_action_server.py
This will start an node for baxter gripper control
then in Matlab use rosaction list. You should now see 2 actions, one for the left gripper and one for the right.
then in Matlab :
[actClient,goalMsg] = rosactionclient('/robot/end_effector/right_gripper/gripper_action');
waitForServer(actClient
goalMsg = 100 % fully open
sendGoalAndWait(actClient,goalMsg,10)
goalMsg = 0 % fully closed
sendGoalAndWait(actClient,goalMsg,10)
  2 件のコメント
Benjamin Brandwin
Benjamin Brandwin 2017 年 4 月 25 日
This also allows you to specify the max effort, which is awesome!
snow John
snow John 2018 年 11 月 26 日
I try this:
[actClient1,goalMsg1] = rosactionclient('/robot/end_effector/right_gripper/gripper_action');
waitForServer(actClient1)
Rightgripper=rosmessage( 'control_msgs/GripperCommandGoal');
Rightgripper.Command.MaxEffort=0;
Rightgripper.Command.Position=90;
goalMsg1=Rightgripper ;% fully open
sendGoalAndWait(actClient1,goalMsg1);
and these codes can control the gripper,but i want to know how to control the gripper's velocity?
thanks for any help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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