Getting imu data from bluerov ros setup. Also how to tune the PID?

Hey, I just wanted help in getting IMU data from the pixhawk. I tried echoing the mavros/imu topic. There is nothing being posted there. I have the pixhawk connected with Pi2 and Pi2 connected to a surface computer. The pixhawk seems to be generating PWM.

Also how can I tune the PID. The mavros topic is saying that the pixhawk is unarmed and mavros is not connected. Pixhawk gets armed when I press start in the controller.

Thanks a lot in advance.

Can you show some output of what you are trying and seeing? What is the output of rostopic list? According to this, it looks like the data you are looking for is published under mavros/imu/data, not mavros/imu.

This is the output of rostopic list,

rostopic echo /mavros/imu/data
rostopic echo /mavros/imu/data_raw

outputs nothing.

/diagnostics
/joint_states
/joy
/joy_f310
/mavlink/from
/mavlink/to
/mavros/battery
/mavros/cam_imu_sync/cam_imu_stamp
/mavros/extended_state
/mavros/hil_controls/hil_controls
/mavros/imu/atm_pressure
/mavros/imu/data
/mavros/imu/data_raw
/mavros/imu/mag
/mavros/imu/temperature
/mavros/local_position/odom
/mavros/local_position/pose
/mavros/local_position/velocity
/mavros/manual_control/control
/mavros/mission/waypoints
/mavros/rc/in
/mavros/rc/out
/mavros/rc/override
/mavros/setpoint_accel/accel
/mavros/setpoint_position/local
/mavros/setpoint_raw/attitude
/mavros/setpoint_raw/global
/mavros/setpoint_raw/local
/mavros/setpoint_raw/target_attitude
/mavros/setpoint_raw/target_global
/mavros/setpoint_raw/target_local
/mavros/setpoint_velocity/cmd_vel
/mavros/state
/mavros/vfr_hud
/mavros/wind_estimation
/rosout
/rosout_agg
/teleop_joy/parameter_descriptions
/teleop_joy/parameter_updates
/tf
/tf_static

This is the output of
rostopic echo /mavros/state
header:
seq: 85
stamp:
secs: 828
nsecs: 164358205
frame_id: ‘’
connected: False
armed: False
guided: False
mode: ‘’

How is the Pixhawk connected to your computer, and how are you launching mavros? You need to set the fcu_url correctly to connect.

Hey Jacob, it worked. Thanks for all your help. I forgot to set up the streaming rate before echoing the topic.

rosservice call /mavros/set_stream_rate 0 10 1

Can you tell me how can I tune the PID.

@charlie.brown There are many PIDs in the software. You can tune the PIDs by adjusting user-settable variables called parameters. The attitude rate control PID coefficients are in the ATC_ group of parameters, the attitude angle control PID coefficients are also in the ATC_ group, the z-axis depth hold parameters are in the POS_, VEL_ and ACCEL_ groups.

-Jacob