ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

Try this code snippet, I think it will work on your case,

  var customSrvClient = new ROSLIB.Service({
    ros : ros,
    name : '/pick_place',
    serviceType : 'my_interface/PickPlace'
  });


  var request = new ROSLIB.ServiceRequest({
    pick : {
      x : 0.1,
      y : 0.2,
      z : 0.3
    },
    place : {
      x : -0.1,
      y : -0.2,
      z : -0.3
    },
    speed: 200,
    arm: 1
  });

  customSrvClient.callService(request, function(result) {
    console.log('Your LOG -> Action performed');
  });

Hello,

Try this code snippet, I think it will work on your case,

  var customSrvClient = new ROSLIB.Service({
    ros : ros,
    name : '/pick_place',
    serviceType : 'my_interface/PickPlace'
  });


  var request = new ROSLIB.ServiceRequest({
    pick : {
      x : 0.1,
      y : 0.2,
      z : 0.3
    },
    place : {
      x : -0.1,
      y : -0.2,
      z : -0.3
    },
    speed: 200,
{ data: 200 },
    arm: 1
{ data: 1 }
  });

  customSrvClient.callService(request, function(result) {
    console.log('Your LOG -> Action performed');
  });

Hello,

Try this code snippet, I think it will work on your case,

  var customSrvClient = new ROSLIB.Service({
    ros : ros,
    name : '/pick_place',
    serviceType : 'my_interface/PickPlace'
  });


  var request = new ROSLIB.ServiceRequest({
    pick : {
      x : 0.1,
      y : 0.2,
      z : 0.3
    },
    place : {
      x : -0.1,
      y : -0.2,
      z : -0.3
    },
    speed: { data: 200 },
    arm: { data: 1 'false' }
  });

  customSrvClient.callService(request, function(result) {
    console.log('Your LOG -> Action performed');
  });