Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find method: 'setEnableNotifications' #1

Open
j55blanchet opened this issue Jul 24, 2023 · 9 comments
Open

Can't find method: 'setEnableNotifications' #1

j55blanchet opened this issue Jul 24, 2023 · 9 comments
Assignees

Comments

@j55blanchet
Copy link

I'm running into the following error when running ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=192.168.137.180

Connecting to a real Nao6 robot.

On a fresh ROS2 foxy docker container, with the following packages installed:

ros-foxy-naoqi-libqi 
ros-foxy-naoqi-libqicore
ros-foxy-naoqi-bridge-msgs
ros-foxy-naoqi-driver

Output

julien@7143d4914d77:~/ws/src$ ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=192.168.137.180
[INFO] [launch]: All log files can be found below /home/julien/.ros/log/2023-07-24-18-54-16-049886-7143d4914d77-1023
[INFO] [launch]: Default logging verbosity is set to INFO
/opt/ros/foxy/share/naoqi_driver/launch/naoqi_driver.launch.py:33: UserWarning: The parameter 'node_executable' is deprecated, use 'executable' instead
  launch_ros.actions.Node(
/opt/ros/foxy/share/naoqi_driver/launch/naoqi_driver.launch.py:33: UserWarning: The parameter 'node_name' is deprecated, use 'name' instead
  launch_ros.actions.Node(
[INFO] [naoqi_driver_node-1]: process started with pid [1028]
[naoqi_driver_node-1] Receiving information about robot model
[naoqi_driver_node-1] Robot detected/NAOqi version: NAO V6.0 / 2.8.7.4
[naoqi_driver_node-1] found a catkin prefix /opt/ros/foxy/share/naoqi_driver/share/boot_config.json
[naoqi_driver_node-1] load boot config from /opt/ros/foxy/share/naoqi_driver/share/boot_config.json
[naoqi_driver_node-1] terminate called after throwing an instance of 'qi::FutureUserException'
[naoqi_driver_node-1]   what():  Can't find method: setEnableNotifications (resolved to '(b)')
[naoqi_driver_node-1] 
[ERROR] [naoqi_driver_node-1]: process has died [pid 1028, exit code -6, cmd '/opt/ros/foxy/lib/naoqi_driver/naoqi_driver_node --ros-args -r __node:=naoqi_driver -r __node:=naoqi_driver --params-file /tmp/launch_params_ruajs2rd'].
@victorpaleologue
Copy link
Contributor

victorpaleologue commented Dec 4, 2023

Hello @j55blanchet, that version was not compatible with NAO6.
Please try again with the latest version of this driver, for iron.
It should work on humble too, but it's still being released.
Would you please confirm that it works?

@j55blanchet
Copy link
Author

@victorpaleologue thanks for the update!

I installed the same packages, but in a fresh ROS2 iron docker container. This time, the driver seemed to start successfully. I was able to run get the node info for /naoqi_driver in a different terminal. However, after about 30 seconds, I got a different error:

julien@6fc9dc349843:/$ ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=192.168.137.250
[INFO] [launch]: All log files can be found below /home/julien/.ros/log/2023-12-04-15-57-16-991487-6fc9dc349843-4788
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [naoqi_driver_node-1]: process started with pid [4793]
[naoqi_driver_node-1] Receiving information about robot model
[naoqi_driver_node-1] Robot detected/NAOqi version: NAO V6.0 / 2.8.7.4
[naoqi_driver_node-1] found an ament prefix /opt/ros/iron/share/naoqi_driver/share/boot_config.json
[naoqi_driver_node-1] load boot config from /opt/ros/iron/share/naoqi_driver/share/boot_config.json
[naoqi_driver_node-1] found a ament URDF /opt/ros/iron/share/naoqi_driver/share/urdf/nao.urdf
[naoqi_driver_node-1] published robot description to /robot_description
[naoqi_driver_node-1] terminate called after throwing an instance of 'qi::FutureUserException'
[naoqi_driver_node-1]   what():         ALProxy::ALProxy
[naoqi_driver_node-1]   Can't find service: ROS-Driver-Audio
[ERROR] [naoqi_driver_node-1]: process has died [pid 4793, exit code -6, cmd '/opt/ros/iron/lib/naoqi_driver/naoqi_driver_node --ros-args --params-file /tmp/launch_params_4tdoz4sh'].

@j55blanchet
Copy link
Author

Also, when I ran ros2 topic pub --once /speech std_msgs/String "data: hello" in a different terminal (before the driver node crashed), it failed to find a matching subscription - and the robot never said anything.

julien@6fc9dc349843:/$ ros2 topic pub --once /speech std_msgs/String "data: hello"
Waiting for at least 1 matching subscription(s)...
Waiting for at least 1 matching subscription(s)...
Waiting for at least 1 matching subscription(s)...
Waiting for at least 1 matching subscription(s)...

This makes me think that perhaps the driver wasn't finished loading. In particular, running ros2 node info /naoqi_driver (again, before the driver crashed), it doesn't subscribe to the /speech topic:

julien@6fc9dc349843:/$ ros2 node info /naoqi_driver       
/naoqi_driver
  Subscribers:
    /parameter_events: rcl_interfaces/msg/ParameterEvent
  Publishers:
    /parameter_events: rcl_interfaces/msg/ParameterEvent
    /robot_description: std_msgs/msg/String
    /rosout: rcl_interfaces/msg/Log
  Service Servers:
    /naoqi_driver/describe_parameters: rcl_interfaces/srv/DescribeParameters
    /naoqi_driver/get_parameter_types: rcl_interfaces/srv/GetParameterTypes
    /naoqi_driver/get_parameters: rcl_interfaces/srv/GetParameters
    /naoqi_driver/get_type_description: type_description_interfaces/srv/GetTypeDescription
    /naoqi_driver/list_parameters: rcl_interfaces/srv/ListParameters
    /naoqi_driver/set_parameters: rcl_interfaces/srv/SetParameters
    /naoqi_driver/set_parameters_atomically: rcl_interfaces/srv/SetParametersAtomically
  Service Clients:

  Action Servers:

  Action Clients:

@victorpaleologue
Copy link
Contributor

victorpaleologue commented Dec 5, 2023

I installed the same packages, but in a fresh ROS2 iron docker container. This time, the driver seemed to start successfully. I was able to run get the node info for /naoqi_driver in a different terminal. However, after about 30 seconds, I got a different error:
[...]

[naoqi_driver_node-1] terminate called after throwing an instance of 'qi::FutureUserException'
[naoqi_driver_node-1]   what():         ALProxy::ALProxy
[naoqi_driver_node-1]   Can't find service: ROS-Driver-Audio
[ERROR] [naoqi_driver_node-1]: process has died [pid 4793, exit code -6, cmd '/opt/ros/iron/lib/naoqi_driver/naoqi_driver_node --ros-args --params-file /tmp/launch_params_4tdoz4sh'].

This is because to get the audio the client needs to expose a service, and therefore respond to a port.

As a consequence, you need to open a port (e.g. 56000) in your docker container, and set it as a listen URL: --qi-listen-url=0.0.0.0:56000.
I'll try to improve that explanation in the README.

Let me know if the rest works better as a result.

@j55blanchet
Copy link
Author

Thanks for the instructions. I exposed port 56000 from the docker container to my host machine, and tried the following command:

ros2 launch naoqi_driver naoqi_driver.launch.py nao_ip:=192.168.137.250 qi_listen_url:=tcp://0.0.0.0:56000 (note the difference from the README - I had to include the tcp:// protocol part of the url.

The same error happened - couldn't find the ROS-Driver-Audio service.

I verified that the port was exposed correctly by relaunching the driver and loading http://localhost:56000/ into a browser on my host machine, which triggered messages in the node's terminal output (like this: [naoqi_driver_node-1] [W] 1701894797.100876 7796 qimessaging.messagesocket: 0x559c911847a0: Incorrect magic from 172.17.0.1 (expected 1118690882, got 542393671).).

Do you have any other suggestions for getting the audio to work & the driver to finish loading?

Also, is there a way to disable the audio features with the version of the driver that is installed through apt-get, or would I need to download the package source to alter the boot_config.json manually?

@victorpaleologue
Copy link
Contributor

victorpaleologue commented Dec 11, 2023

I admit I don't understand why it would not work.

The port opened is not for an HTTP service hence the issue with the browser and the "incorrect magic".

You should be able to edit the ̀boot-config.json` (in /opt/ros/iron/share/naoqi_driver/share/boot_config.json) as a sudoer to disable the audio. I know it's ugly, but otherwise you'd have to build it from source.

@j55blanchet
Copy link
Author

j55blanchet commented Dec 11, 2023

I admit I don't understand why it would not work. Please book a session with me here so that we sort it out.

Sounds good, I've booked a session on your calendar.

You should be able to edit the ̀boot-config.json

  • 🟢 I did so, and now the driver finishes startup! I'm able to get the robot to say things by publishing to /speech.

  • ❓I received the following warning in startup:

[naoqi_driver_node-1] naoqi_driver initialized
[naoqi_driver_node-1] Starting ROS loop
[naoqi_driver_node-1] [ERROR] [1702317171.405812038] [naoqi_driver]: Could not compute NAO Footprint: no transform is possible (1702317171.138689 seconds)
  • However, publishing to /joint_angles to move the robot's head didn't result in any movement at first, nor did publishing to /cmd_vel.
    • 🟢 I thought this might be due to the robot being in the resting pose, so I used the python3 libqi bindings outside of ROS to set it to the stand posture. Once I did that, the robot was responsive to messages to both of these.
    • ❓Is there any way to set the posture from the ros interface?
    • ❓Is there any way to read / subscribe to the robot posture from ros?

@victorpaleologue
Copy link
Contributor

I admit I don't understand why it would not work. Please book a session with me here so that we sort it out.

Sounds good, I've booked a session on your calendar.

You should be able to edit the ̀boot-config.json

* 🟢 I did so, and now the driver finishes startup! I'm able to get the robot to say things by publishing to `/speech`.

Great!

* ❓I received the following warning in startup:
[naoqi_driver_node-1] naoqi_driver initialized
[naoqi_driver_node-1] Starting ROS loop
[naoqi_driver_node-1] [ERROR] [1702317171.405812038] [naoqi_driver]: Could not compute NAO Footprint: no transform is possible (1702317171.138689 seconds)

This one is not a problem. It's not nice but it's only happening few times at startup, it's alright.

* However, publishing to `/joint_angles` to move the robot's head didn't result in any movement at first, nor did publishing to `/cmd_vel`.
  
  * 🟢 I thought this might be due to the robot being in the resting pose, so I used the python3 libqi bindings outside of ROS to set it to the stand posture. Once I did that, the robot was responsive to messages to both of these.

This is ok. In the README I rather recommend to call for ALMotion.wakeUp. Let me know if that does not work.

  * ❓Is there any way to set the posture from the ros interface?

No.

  * ❓Is there any way to read / subscribe to the robot posture from ros?

Nope.

These APIs can be found here, though.

@victorpaleologue
Copy link
Contributor

victorpaleologue commented Apr 30, 2024

Do you have any other suggestions for getting the audio to work & the driver to finish loading?

I have a fresh suggestion. Please share your Dockerfile, your docker-compose.yml and your command line to check that everything about port forwarding is lined up. Whether the port is available from the robot will depend on whether the port is exposed on the public IP of the host.

You can also perform this check, from the robot:

wget $public_ip:56000

(replace $public_ip by yourself), and see whether you get the same effect as when you connect a browser.

@victorpaleologue victorpaleologue self-assigned this Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants