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

RC Override data array full: how to add more motor control via joystick? #31

Open
bcdupree opened this issue Oct 31, 2018 · 4 comments
Open

Comments

@bcdupree
Copy link

I am attempting to control an ROV with mavROS. I have Ardusub code running on a Pixhawk 4. On the topside I am running mavROS to facilitate camera input amongst other sensor streams and provide the ROS specific implementation of Mavlink. I am publishing messages to mavROS topics using an XBox controller.

My startup command in terminal is:

'roslaunch bluerov_ros_playground user_mav.launch'

I am getting perfect control of my 8 existing ROV thrusters using the 2 joysticks on the XBox controller. What I would like to do is add 2 more thrusters that only need stepwise speed control via 2 buttons on the controller (RB and RT). The commands would simply be step up speed in a clockwise direction on both thrusters or step up speed in the anticlockwise direction on both thrusters.

In 'src/bluerov/user.py', the commands for the 8 existing thrusters are sent to the Pixhawk via the ROS topic 'RCOverrideIn'. This data array for this topic is full however. How do I create an equivalent topic on which to publish the commands for my additional 2 thrusters?

I have tried adding in code like:

            if buttons[5] == 1: # Both Additional Motors Speed Up Clockwise
                thrust = [0.5] # THIS IS AN ARBITRARY VALUE BETWEEN 0 and 1 for now
                self.pub.set_data('/mavros/setpoint_attitude/thrust', thrust)

but I am not sure if the Thrust topic is the ideal one to be using.

Any help much appreciated! Also I am new to ROS, apologies for the noob questions in advance.

@patrickelectric
Copy link
Owner

Do you want to control the thrusters individually ?
That's not possible, it's only possible to send vertical and horizontal control reference to ArduSub.

@bcdupree
Copy link
Author

bcdupree commented Nov 1, 2018

Sorry im an idiot for calling them thrusters. They are actually extra motors that are not used for thrusting. The idea is that they would be controlled in unison.

@bcdupree
Copy link
Author

bcdupree commented Nov 2, 2018

Ardusub has a parameter called 'cam_tilit' in joystick.cpp that maybe we could use to send a pwm to 2 other motors? However I cannot find the equivalent parameter/data structure in the python libraries of the bluerov playground. how would we go about adding the appropriate python code on the topside?

@bcdupree
Copy link
Author

bcdupree commented Nov 2, 2018

sorry 'cam_tilt'

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