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

How to call a custom service?

asked 2016-07-28 07:29:45 -0600

neckutrek gravatar image

My service (AddTask.srv) is defined as:

string       name          
string       type         
string[]     behaviour     
uint16       priority     
bool         visibility   
string[]     parameters

and my rosservice call is

rosservice call /mynamespace/addTask \
'name: "mytask", type: "TaskPoP", behaviour: ["TaskBehFO", "10"], priority: 1, visibility: 1, parameters: ["gripper_r_base", "0", "0", "0.1", "gripper_l_base", "1", "0", "0", "0.2"]'

and I get this error message:

yaml.parser.ParserError: while parsing a block mapping
  in "<string>", line 1, column 1:
    name: "mytask", type: "TaskPoP", ... 
    ^
expected <block end>, but found ','
  in "<string>", line 1, column 15:
    name: "mytask", type: "TaskPoP", behaviour: [" ...

What does the error message mean and how do I resolve it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-07-28 07:46:35 -0600

neckutrek gravatar image

The commas must be exchanged for line-breaks as such:

rosservice call /mynamespace/addTask \
'name: "mytask"
type: "TaskPoP"
behaviour: ["TaskBehFO", "10"]
priority: 1
visibility: 1
parameters: ["gripper_r_base", "0", "0", "0.1", "gripper_l_base", "1", "0", "0", "0.2"]'
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-28 07:29:45 -0600

Seen: 643 times

Last updated: Jul 28 '16