SICKAG / sick_lidar_localization

Apache License 2.0
24 stars 10 forks source link

rosservice call doesn't work #11

Closed simk0024 closed 2 years ago

simk0024 commented 3 years ago

i have lidarloc 2.0.0.14R installed and latest release of sick_lidar_localization package v5.3.0 launched. In Rviz, i could get the right TF of robot pose, but i could not use the rosservice like LocInitializeAtPose, getting "False" result as below.

rosservice call /LocInitializeAtPose "x: 100 y: 100 yaw: 0 searchradius: 50"
success: False

If there any configuration required to make rosservice works?

rostest commented 3 years ago

Thanks for reporting. The services require their arguments in a json-syntax (colon separated and with brackets)l:

rosservice call LocInitializeAtPose "{x: 100, y: 100, yaw: 0, searchradius: 50}"

This should result in successfull execution.

For further diagnosis in case of errors, it's possible to send commands directly using curl:

curl -i -H "Content-Type: application/json" -X POST -d "{\"data\":{\"x\":100,\"y\":100,\"yaw\":0,\"searchradius\":50}}" http://192.168.0.1/api/LocInitializeAtPose

Ros services are the preferred way. The native curl command display the SIM response "as is" without any conversion, which can help in case of unexpected results. See https://github.com/SICKAG/sick_lidar_localization/blob/master/doc/sick_localization_services.md for details.

simk0024 commented 3 years ago

Hi,

I tried both.

  1. for using rosservice call using json-syntax, I received same result

    rosservice call LocInitializeAtPose "{x: 100, y: 100, yaw: 0, searchradius: 50}"
    success: False
  2. for using curl, here is the response i received.

    
    data\":{\"x\":100,\"y\":100,\"yaw\":0,\"searchradius\":50}}" http://127.0.0.1/api/LocInitializeAtPose
    HTTP/1.1 502 Bad Gateway
    Server: nginx/1.14.0 (Ubuntu)
    Date: Thu, 02 Dec 2021 16:33:58 GMT
    Content-Type: text/html
    Content-Length: 182
    Connection: keep-alive
502 Bad Gateway

502 Bad Gateway


nginx/1.14.0 (Ubuntu)
rostest commented 2 years ago

"Bad Gateway" means the SIM is unreachable. Please check the IP-adress in the curl command: The default SIM-server has IP 192.168.0.1. Argument "http://127.0.0.1/api/LocInitializeAtPose" (i.e. localhost) was probably not intended. You can also try to query the system state with rosservice call LocIsSystemReady "{}" resp. curl -i -H "Content-Type: application/json" -X POST -d "{}" http://192.168.0.1/api/IsSystemReady

simk0024 commented 2 years ago

what is SIM-server?

I am doing REST request and rosservice call on same device, i.e. IPC with both SICK LidarLoc 2.0 and ROS package running. The IPC is connecting to SICK TIM571 Lidar Sensor via LAN, [IP_ADDRESS=192.168.1.5].

I tried the rosservice call LocIsSystemReady "{}", and success: False received. Unable to exec curl command with IP 192.168.0.1 as this address not found.

rostest commented 2 years ago

The SIM is the localization controller, which is connected to both the PC and the Lidar sensor. See https;//cdn.sick.com/media/docs%2F0%2F20%2F720%2Foperating_instructions_operating_instructions_en_im0082720.pdf for details. The IP of this localization server (SIM) is the address for the curl commands. Please make sure that the server is reachable for http requests.

simk0024 commented 2 years ago

In my case, I don't use localization controller. I use industrial PC, as described in figure below:

image

rostest commented 2 years ago

I see, thanks! We'll have to investigate and reply soon.

tbohnma commented 2 years ago

For the sake of completeness, the SIM is a controller from SICK to run LiDAR-LOC. Alternatively, as @simk0024 has posted, LiDAR-LOC can run on any IPC. In this case the bad answers might be from a not activated Software. I'll keep this ticket open until we have further information.

tbohnma commented 2 years ago

I'll close this issue due to inactivity