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
Problem with cmd_vel for steering the rover #1055
Comments
Unfortunately i do not see anything in this logs, except strange FW version reports. Also how autopilot is connected to mavros? High Round-Trip Time looks weird. |
Thanks for your reply. I am using a rover (which can be as well called a drone, but just for avoiding confusion :D). The wiring is fine, since the manual + auto (WP from MP) work just fine, in addition i am able to communicate with the pixhawk, so i doubt that the wiring is the problem. I have tried to connect the autopilot through the usb port on the pixhawk, and the telemetry port, but the results are the same. Is there a way to send direct commands to the motors? something similar to rcoverride that was before? |
You may try COMMAND_LONG with DO_SET_SERVO. |
I am trying to send this command (to turn the right wheel attached to output 1 for 10 cycles of 10s): rosservice call /mavros/cmd/command "{broadcast: true, command: 184, confirmation: 0, param1: 1.0, param2: 1600.0, param3: 10.0, param4: 10.0, param5: 0.0, param6: 0.0, param7: 0.0}" Nothing is happening, should the rover be in GUIDED mode when using DO_SET_SERVO? or just manual mode? Edit: I tried as well with |
DO_SET_SERVO isn't implemented on on ArduPilot Rover (you write you are using PX4 but speak about Guided). |
I have already tried to set SYSID_MYGCS to 1 but the RC override was still present. I will try to change the frame and see if this will solve the problem. |
Hi guys. I got into the same issue:
Waiting for more comments. [New update] [New update]
|
Thank you for your feedback. I have other projects going on, but for now i just used an arduino with a 5v switch in order to choose between who takes control of the ESCs (pc or Pixhawk)...It is a quick and dirty solution for my autonomous visual tracking and other schemes, but it works just fine. I will try your trick soon (hopefully) |
You have to set the MAV_FRAME to the local bodyframe so that the commands are processed in that coordinate system. Just run: Here are more frames to try: |
Hello guys, I finally figured it out, and i can now control the velocity of the rover directly through mavros. First, the rover should be in GUIDED mode. To do this, whether you set this though your RC via MP or other GUI, or you simply use mavros. In another terminal (besides the one running mavros with the adequte autopilot, for me i used apm2.launch):
Once the mode is changed, you can try publishing on the following topic: /mavros/setpoint_velocity/cmd_vel (for the rover, linear velocity on the x, and angular around z). You should be able to see the rover moving for few seconds.
|
@Chouaibharik Thanks for the feedback ! I glad you manage to make it work . |
@Chouaibharik When you got it working what did you set your setpoint/velcoity/mav_frame to? Is it LOCAL_NED or BODY_NED? I am also curious that in the TwistStamped message that you are publishing you have left the frame id slot. Did you leave it blank in your implementation as well?
Please let me know. |
I haven't set the mav frame, and I left the frame id blank on the implementation as well. |
frames.pdf
I do this and still get no response from the rover. I don’t know where I am going wrong. Any suggestions would be helpful. These are my mavros params:
PARAMETERS
NODES ROS_MASTER_URI=http://localhost:11311 process[mavros-1]: started with pid [20916] |
Do you see the topic /mavros/rc/override on the topics list? |
Yes and nothing is published on it. |
Of course not, it is a topic where you emulate a RC, so naturally nothing is published on that topic. Try to publish on it (just use rostopic pub command), while choosing the right channel for your motors. |
@Chouaibharik @githinkgp Also, changing the angular/z value will not be steering, when the linear/x value is set to -1, the vehicle rotates clockwise in place as it moves forward. The mode is the "Offboard" mode and the mavros/state/guided value is true. If you've solved it, could you explain it in more detail? |
Have you tried the steps i explained in #1055 (comment) ? |
@Chouaibharik Of course,
But the results are the same. |
@kissw First, are you sure your autopilot is a px4 not an APM?. Second, you will need to add the guided mode on MP (for my case, i have a three way switch that i can chose between Stabilize, Guided and, Auto). Then the switch will be on the Guided position in order to be able to pass the commands to the autopilote. |
@kissw I enabled velocity control for rover on px4. However, this was only enabled after PX4 v1.10 what version are you using? |
@Chouaibharik @Jaeyoung-Lim |
@kissw Which master are you on? If you are on master, you should be better of than 1.10 since the actuator controls should also be included. Relevent PRs: |
@kissw MP is Mission Planner. |
@Jaeyoung-Lim I tried to v1.11.0-beta1, but I still this ploblem. |
@kissw Oh, sorry. The vehicle will not reverse since it is constrained. you can change that here: https://github.com/PX4/Firmware/blob/master/src/modules/rover_pos_control/RoverPositionControl.cpp#L301 |
@Jaeyoung-Lim |
@kissw Currently for offboard mode, the mavlink messages that are supported are listed in the docs, which mavros sends. It does not support path planning but supports following setpoints such as position, velocity, actuator setpoints. It does not support angular velocities, although I was planning to add it. You can still use linear velocity in both body and local frame or use actuator controls directly. Were you able to make the rover go reverse with the suggested changes? Since this thread is not directly related to your issue, I would prefer moving this discussion to a forum, somewhere like discuss.px4.io |
@Jaeyoung-Lim |
@kissw That is why it was constrained. You need additional logic to handle reverse. Attitude setepoints support reverse: PX4/PX4-Autopilot#13429 |
I was using /mavros/rc/override on a pixhawk 1 in order to control the rover via an external pc, and this worked just fine. However, i needed to upgrade to the pixhawk 2 (the first one died), and now the RCoverride is no longer supported so i try now to control the rover by publishing to /mavros/setpoint_velocity/cmd_vel on GUIDED mode (otherwise the rover wouldn't respond).
Nonetheless, weird things are happening:
1- Sending +0.1 on twist.linear.x makes the robot moves forward (which is normal), but sending the same value on twist.linear.y makes the robot moves forward as well (which is not logical since this is not a holonomic platform, so no direction on the Y axis should be possible).
2- Sending -0.1 on twist.linear.x does not make the robot to move backward, but forward as well???
3- The angular velocity (twist.angular.z) seems to work fine with speed and direction (the robot is a bit shaking when turning on its center of gravity).
Any ideas about this?
Thank you in advance
Issue details
Please describe the problem, or desired feature
MAVROS version and platform
Mavros: latest_from_apt-get
ROS: Kinetic
Ubuntu: 16.04
Autopilot type and version
[ ] ArduPilot
[X] PX4
Version: 3.4.0
Node logs
Diagnostics
Check ID
The text was updated successfully, but these errors were encountered: