naoki-mizuno / ds4_driver

DualShock 4 driver for both ROS1 and ROS2
http://wiki.ros.org/ds4_driver
85 stars 53 forks source link

Issues on Humble #34

Closed adityakamath closed 1 year ago

adityakamath commented 1 year ago

I am having some issues with the Humble branch, which I am unable to explain. I first thought I was having some connection issues, but then realized that the ds4_twist_node stops publishing any data altogether after a while (the /status topic is published and the twist_node seems to be subscribed). Also the /set_feedback (rumble/led control) does not work. I don't think this is because of my recent commits (separating the messages from the nodes), but I am not entirely sure.

For context, I am using Ubuntu 22.04.1 with a RT kernel (Kernel version: 5.15.39-rt42-raspi), so I am not sure if that is causing any issue. I was wondering if someone else can test the Humble branch (with any config) and check if they also have the same problem, or if it is just me.

Meanwhile, I would recommend going back to foxy-devel as the default branch and adding an "untested" comment in the readme of the Humble branch.

naoki-mizuno commented 1 year ago

Hmm... Could you check if the demo.launch.xml works as expected? A while ago when I tried it out it seemed to be working fine. That said, I didn't leave it running for more than a few minutes. How long does it take for the problem to appear in your environment?

Moving the left/right stick controls the rumble. Sliding left and right on the touchpad while pressing circle, triangle, cross buttons controls the brightness of the red, green, blue LED, respectively (you can tell from the color of the button). Pressing the PS button triggers the flashing of the LED.

adityakamath commented 1 year ago

I'll try it today evening and update you. I tried it for a short period of time few days ago and it worked. On the weekend, I launched the twist and feedback nodes from a different launch file and I noticed that the set feedback does not work at all, and the twist node dies after a while. It's strange because the main driver node keeps running (the /status topic is always updated)

adityakamath commented 1 year ago

I completely forgot about this. I tried the demo file today, and I get the same issue. Cannot set LED colors, flashing or rumble. Also, the twist publisher node does not die but the publisher does not publish anything. /Status topic is published correctly.

naoki-mizuno commented 1 year ago

Thanks for trying it out. I also tried it on my environment (with Docker) and I think I was able to reproduce this issue. My guess is that the status publish rate was too fast (approx. 560 Hz) because I wasn't doing any throttling. I was also getting a lot of lagging for the feedback when using the demo node on a Bluetooth connection.

I pushed some code that hopefully fixes this issue; could you try it out? The issue I'm seeing with this change is that, although the publish rate is supposed to be around 100 Hz with the default parameter, I'm only getting ~80Hz (both via USB and Bluetooth). It would be helpful if you could also check if this happens in your environment (ros2 topic hz /status).

adityakamath commented 1 year ago

Thanks for the update! I tried it on my RPi 4 with Ubuntu 22.04 and a RT kernel. It works well now, the twist publisher does not die after a while. I get an average publish rate of ~80Hz as well (both /status and /cmd_vel), although sometimes it goes up to 96-97 Hz. I only tried over Bluetooth.

I still have the issue of not being able to set feedback (neither LED colors nor rumble. I even tried setting the LED color using ds4drv, but nothing). I still think the RT kernel is causing issues here, and I intend to try it out on another RPi without the RT kernel later, when I get the time.

For now, the major issue for me has been solved (thanks again!) and this issue can be closed.

naoki-mizuno commented 1 year ago

Awesome! Thanks for the follow-up. I'll merge the change into humble-devel and see if I can figure out what's causing the ~80 Hz publish rate.

Thanks for reporting this issue!