RoboticaUtnFrba / create_autonomy

ROS autonomy stack for iRobot Create 2.
BSD 3-Clause "New" or "Revised" License
28 stars 38 forks source link

Control the robot in gazebo simulation #210

Closed zhuang42 closed 4 years ago

zhuang42 commented 4 years ago

Hello,

Sorry for bothering you. It might be a stupid question. I am new to ROS, and I am trying to run the gazebo simulation. It turns out that keyboard_teleop.launch can not control (does not affect) the robot in the gazebo. Is there something I was missing?

The commands I ran are

roslaunch ca_gazebo create_house.launch
roslaunch ca_tools keyboard_teleop.launch

Thanks for your help in advance

eborghi10 commented 4 years ago

Since this simulation supports multiple robots, it issues something called namespaces to remap topics. See here.

Anyways, you should be able to make it work without any change.

What do you get doing rostopic list?

zhuang42 commented 4 years ago

Here is the output,

$ rostopic list
/clock
/constraint_list
/create1/bumper
/create1/cliff
/create1/cmd_vel
/create1/gts
/create1/imu/data
/create1/joint_states
/create1/mobile_base/sensors/bumper_pointcloud
/create1/move_base/NavfnROS/plan
/create1/move_base/TebLocalPlannerROS/global_plan
/create1/move_base/TebLocalPlannerROS/local_plan
/create1/move_base/TebLocalPlannerROS/obstacles
/create1/move_base/TebLocalPlannerROS/parameter_descriptions
/create1/move_base/TebLocalPlannerROS/parameter_updates
/create1/move_base/TebLocalPlannerROS/teb_feedback
/create1/move_base/TebLocalPlannerROS/teb_markers
/create1/move_base/TebLocalPlannerROS/teb_poses
/create1/move_base/TebLocalPlannerROS/via_points
/create1/move_base/cancel
/create1/move_base/current_goal
/create1/move_base/feedback
/create1/move_base/global_costmap/costmap
/create1/move_base/global_costmap/costmap_updates
/create1/move_base/global_costmap/footprint
/create1/move_base/global_costmap/inflation_layer/parameter_descriptions
/create1/move_base/global_costmap/inflation_layer/parameter_updates
/create1/move_base/global_costmap/obstacle_layer/parameter_descriptions
/create1/move_base/global_costmap/obstacle_layer/parameter_updates
/create1/move_base/global_costmap/parameter_descriptions
/create1/move_base/global_costmap/parameter_updates
/create1/move_base/global_costmap/static_layer/parameter_descriptions
/create1/move_base/global_costmap/static_layer/parameter_updates
/create1/move_base/goal
/create1/move_base/local_costmap/costmap
/create1/move_base/local_costmap/costmap_updates
/create1/move_base/local_costmap/footprint
/create1/move_base/local_costmap/inflation_layer/parameter_descriptions
/create1/move_base/local_costmap/inflation_layer/parameter_updates
/create1/move_base/local_costmap/obstacle_layer/parameter_descriptions
/create1/move_base/local_costmap/obstacle_layer/parameter_updates
/create1/move_base/local_costmap/parameter_descriptions
/create1/move_base/local_costmap/parameter_updates
/create1/move_base/parameter_descriptions
/create1/move_base/parameter_updates
/create1/move_base/result
/create1/move_base/status
/create1/move_base_simple/goal
/create1/nodelet_manager/bond
/create1/odom
/create1/rplidar/scan
/create1/wall
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/landmark_poses_list
/map
/map_updates
/rosout
/rosout_agg
/scan_matched_points2
/submap_list
/tf
/tf_static
/trajectory_node_list

The speed displayed in the teleop changes as I pressed control keys. But when I rostopic echo /create1/cmd_vel, the values remain static.

rostopic echo /create1/cmd_vel -n 1
linear: 
  x: 0.0
  y: 0.0
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: 0.0
---

Thanks for your replying, I looking into namespace you mentioned

eborghi10 commented 4 years ago

Oh, I know what's going on!

Check the output of the node. You should move the robot with particular keys (not the arrows), these are: i, j, l, ,, ...

zhuang42 commented 4 years ago

I didn't notice that q/z/w/x are used to control max speed!

Thank you!