psr_21-22
psr_21-22 copied to clipboard
PS3 joystick not working with Rviz
Good afternoon @miguelriemoliveira , I was trying to win your record with the ps3 joystick but a problem occurred.
Starting, I did the following command:
roslaunch turtlebot3_fake turtlebot3_fake.launch
And in another terminal:
roslaunch teleop_twist_joy teleop.launch
Where I receive the following warning:
[ WARN] [1641932662.289011177]: Couldn't set gain on joystick force feedback: Bad file descriptor
I also went to see the rqt_graph that gave me the following image:
I think everything looks fine and the robot doesn't move, I used the keyboard launch file and everything works well.
After that I went to see if the joystick was detected
I wrote in the terminal:
ls /dev/input/
and I received:
by-id event13 event2 event8
by-path event14 event20 event9
event0 event15 event3 js0
event1 event16 event4 mice
event10 event17 event5 mouse0
event11 event18 event6 mouse1
event12 event19 event7
So that means that it does detect the joystick, in the js0.
I decided to test it, I used:
sudo jstest /dev/input/js0
And I got a positive response, the buttons and joystick all changed values when I used the joystick
I don't know what else to try, does the professor have some tips to solve this problem?
Thank you, Sara
I forgot to add:
When I see the :
rostopic echo /joy
The values also change! I receive something like this:
header:
seq: 13951
stamp:
secs: 1641934124
nsecs: 932691384
frame_id: "/dev/input/js0"
axes: [0.2784116566181183, 1.0, 0.0, -0.0, -0.0, 1.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header:
seq: 13952
stamp:
secs: 1641934124
nsecs: 942653517
frame_id: "/dev/input/js0"
axes: [0.3962130844593048, 1.0, 0.0, -0.0, -0.0, 1.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Hi @Sarxell ,
From what you say you are using the fake turtlebot node. That is for ex1 only. Then we move on to gazebo, ans that's the simulator we will use.
The manual race is ex9. Did you get this far?
About the joystick, you can use the ros joystick driver node to replace the teleop, which seems to be well configured in the image above. Also, because you do a ros topic echo and the message content changes as you move the joystick, the joystick configuration should be fine.
So my guess is focus on putting the system working on gazebo.
Let me know how it went.
Hi @miguelriemoliveira ,
Okay , I changed the robot to the gazebo simulator. Right now my rqt_graph looks like this:
When I do:
rostopic echo /joy
The joystick continues working but my robot still doesn't move
does the robot move when you use the teleop?
Also, notice p_spombinho/cmd_vel is not being subscribed by any node.
Yes, it moves when I use the teleop, I also was trying now with the android and it works, so I guess I will stick to that! About not being subscribed it's weird because it also happens with the keyboard and the android and it still works (?) I will try to change it
I'm sorry I didn't show the rqt_graph completed
!
He is subscribed by gazebo, the rqt_graph is just very ugly
hum, your rqt graph is strange... gazebo receives the cmd_vel as it was supposed to occur, but no node is publishing it???
Click the debug and other checkboxes to see if they appear
In that rqt_graph I wasn't moving the robot, it was just to show that the gazebo was subscribed to the cmd_vel, I forgot to say that, sorry
With the android connected , I get the following rqt_graph:
and with the joystick connected, what graph do you have?
With the joystick I have this rqt_graph:
Seems to be working fine. Not sure what is wrong ...
Can you bring your joystick to the practical class?