wilselby / ROS_quadrotor_simulator

Quadrotor simulator using ROS, Gazebo, and RVIZ
270 stars 125 forks source link

problem of executing the planning #23

Open benbenji opened 6 years ago

benbenji commented 6 years ago

Dear professor Wiselby: I ran your code in my computer(ubuntu 14.04 indigo) but I face a new problem.The plan of moveit! is ok.The trail can appear in the rviz like this picture. rviz_quad But after I clicked execute button,the rviz showed the planning is executed but nothing happened in gazebo like this picture,and the status of the robot did not update. gaze_quaz The terminal aslo showed the execution is successful. terminal the rqt_graph is as this picture rosgraph_quaz this is another error "[ERROR] [1513682297.860795914]: Couldn't open joystick /dev/input/js0. Will retry every second." I don't have a joystick so I just ignore it.the "/multi_dof_joint_trajectory_action/goal" can be printed when I clicked execute and "/multi_dof_joint_trajectory_action/result" is "header: ### seq: 1 stamp: secs: 354 nsecs: 285000000 frame_id: '' status: goal_id: stamp: secs: 352 nsecs: 661000000 id: /move_group-2-352.661000000 status: 3 text: '' result: error_code: 0 ---" However,I found the "/cmd_vel" which is published by action_controller is empty.on the contrary .The "/cmd3d_nav" have content as " x: 0.0 y: 0.0 z: 0.0 acceleration: x: 0.0 y: 0.0 z: 0.0 jerk: x: 1.0 y: 0.0 z: 0.0 snap: x: 0.0 y: 0.0 z: 0.0 yaw: 1.52000000044 yaw_rate: 0.0 ---" The "/cmd_3dnav"'s info is shown as follow "Type: mav_msgs/CommandTrajectory

Publishers:

Subscribers:

wilselby commented 6 years ago

You need to enable the mode that reads in the computed trajectory. You should first enable GPS mode. This is currently done by pressing "B" on the Xbox. After that you can launch the quad with "A." When you execute the trajectory, then you need to press "LB." This is all on an Xbox controller but you can edit this in the following file:

https://github.com/wilselby/ROS_quadrotor_simulator/blob/master/quad_joystick_interface/src/joy.cpp

Hope that helps!

benbenji commented 6 years ago

Thank you professor.I know the problem,I will try as your word,best wish! @wilselby

Yogi30 commented 6 years ago

@benbenji how did you do that ? I'm stuck at the same point.

KenanA17 commented 4 years ago

It might be late, but someone might still want this. I found a workaround. You can simulate joystick through ROS topic "/quad/joy", since this is where the joystick message would go if you had used one. You just need to send the right ROS topic message that would simulate "B" and "LB" buttons from joystick, i.e. open a new command line window and publish this message ("B"):

rostopic pub /quad/joy sensor_msgs/Joy "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' axes: - 0 buttons: - 1"

Now you stop publishing previous message and publish a new one ("LB"):

rostopic pub /quad/joy sensor_msgs/Joy "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' axes: - 0 buttons: - 4"

Number 1 means B, and number 4 means LB. You can use this method to simulate other possible joystick commands. Conversions can be found here http://wiki.ros.org/joy.