Home        Store        Docs        Blog

Joystick Issue: Connection to joystick device lost unexpectedly

(imoe) #1

Hi there,

I’m trying to use bluerov and bluerov_app ROS packages to control my BlueROV. The approach I’m trying now is to control the ROV using joystick through ROS and then send commands to joystick topic to control the ROV autonomously. (Is this a good approach? Is there any other recommended way to do this?)

I’m now running:

  • ROS master my ground computer
  • launch bluerov_r1.launch on companion computer(RPi with Ubuntu image, ROS and bluerov pkgs installed)
  • launch joystick node in bluerov_apps pkg on ground PC with joystick connected to it

I always receive message in joystick console as

Connection to joystick device lost unexpectedly. Will reopen.

Even if I tried to run all the nodes on ground PC, the same problem occurs again.
If I run the original ROS node for joystick ( rosrun joy joy_node_teleop), this error doesn’t appear.

Has anybody faced this problem?

(Patrick José Pereira) #2

Hi @imoe,

This is one of the possible approaches, you can use the actual bluerov package to perform this, right now we are working on a new package (bluerov_ros_playground) and almost done for a release. Maybe you want to try it to do some simulations or control the ROV.

About your problem with the old package, can you show all the commands that you are using to launch the teleop ?

(imoe) #3

Hi @patrickelectric, thanks for your response.

What I’m trying to do is to control Pixhawk through MavROS to make the ROV fully autonomous as these commands can be sent from companion computer( where I installed Ubuntu 16 and ROS kinect as well as bluerov pkgs on the companion RPi). Now my ground PC and RPi with Ubuntu are both ROS and bluerov pkgs installed, configured in a same network.
My commands are:

roscore (on ground PC as it’s currently set to be ROS master)
roslaunch bluerov bluerov_r1.launch ( on RPi as the Pixhawk is connect to it and camera module is on it)
roslaunch bluerov_apps teleop_f310.launch ( on ground PC as I connect the joystick to it)

Here’s the rqt_graph at this time.

Then the error below appears whenever I sent any command through joystick.

Connection to joystick device lost unexpectedly. Will reopen.

I also tried to send some commands directly through rosservice or rostopic pub, but only one of them worked.

rosservice call /mavros/cmd/arming “value: true”

By using this command, I can arm the ROV(indicated by the LED on PixHawk). But other commands such as publish to setpoint_velocity don’t work(no motor rotates).

Joystick control via QGroundControl is always fine. But I need to

  1. Use joystick node in ROS to control the vehicle
  2. Send command through ROS to control the vehicle( through waypoints, etc)

Any suggestions? Thank you. (Hope I have stated everything clear)

(Patrick José Pereira) #4

You are not able to set speed reference without a position system (E.g: GPS), the software derivative the position to use it as a velocity reference for the control loop.
Take a look here to check the modes that you can use with/without position reference.

Are you using the F310 joystick ? Do you see the device in /dev ?

If you want to test the RC, you can use: rostopic pub -r 1 /mavros/rc/override mavros_msgs/OverrideRCIn '[1300, 1300, 1300, 1300, 0, 0, 0, 0]'

To control it using waypoints you’ll need a position system.

(imoe) #5

Thanks for this. I check the devices and found out my F310 is /dev/input/js0. After changing corresponding line in the f310 launch file, it worked!

This works fine on my side. Thanks!

My questions here are:

  1. Then if there’s no position system, how do you send commands to the ROV to control it other than direct OverrideRCIn? For example is it possible to let it go 1m in x direction or something similar? Will only IMU information be enough for the ROV to move desirably?
  2. What are the position system you guys are using for the ROV? I guess USBL?
    In theory, if I can send position information to the ROV (even if I put it on the ground and use motion capture or GPS), it will take waypoint commands, right?

Thanks again for your reply, it really helps!

(Patrick José Pereira) #6

It’s not possible to send position or velocity commands without a position system, the IMU is not enough to estimate velocity or a Cartesian position.

Here you can check our underwater GPS products.

Yes, that’s correct, you can send the position information via MAVLink :slight_smile:

If you want to check how each mode work, take a look here, the file is: control_mode.cpp