Difference between revisions of "ROS"

From Review or Discard at Will
Jump to: navigation, search
(add syntax for talker / listener)
m (Gazebo)
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{blockquote| At the time this page primarily exists to jog my memory of specific commands and resources as I drink from the initial fire hose of learning ROS.}}
+
=Robot Operating System=
 +
{{blockquote| At the time this page primarily exists to jog my memory of specific commands and resources as I drink from the initial fire hose of learning ROS.
 +
I'm staring my learning with debian 9 stretch on an HP tx2000 notebook with a full desktop install of [http://www.ros.org/ ROS] lunar. And a partial install on a [https://beagleboard.org/blue BeagleBone Blue].
 +
}}
  
jeffa@lunar$  
+
In the following lunar is an HP tx2000 notebook, bluemoon is the BBBlue.
* export ROS_MASTER_URI=http://lunar:11311
+
==Resources==
* source ~/catkin_ws/devel/setup.bash
+
===shell commands===
 +
<source lang="bash">
 +
* jeffa@lunar:~$ export ROS_MASTER_URI=http://lunar:11311
 +
* jeffa@lunar:~$ source ~/catkin_ws/devel/setup.bash
  
* rosrun roscpp_tutorials listener
+
* jeffa@lunar:~$ rosrun roscpp_tutorials listener
* rosrun roscpp_tutorials  talker
+
* jeffa@lunar:~$ rosrun roscpp_tutorials  talker
 +
* jeffa@lunar:~$ roscd roscpp_tutorials
 +
</source>
 +
===turtlesim===
 +
<source lang="bash">
 +
jeffa@lunar:~$ rosrun turtlesim turtlesim_node
 +
jeffa@lunar$ rosrun turtlesim turtle_teleop_key
 +
 
 +
jeffa@bluemoon:~$ export ROS_MASTER_URI=http://lunar:11311
 +
jeffa@bluemoon$ rosrun turtlesim turtle_teleop_key
 +
</source>
 +
 
 +
===Guides===
 +
* [[http://cs460.coins-lab.org/index.php?title=Eclipse Handy setup guide]] for eclipse.
 +
 
 +
==gazebo key_teleop rover==
 +
[http://answers.ros.org/question/231265/using-keyboard-to-control-the-robot-in-gazebo/ using keyboard to control the robot in gazebo.] answers.ros.org
 +
<source lang="bash">
 +
jeffa@bluemoon:~$ export ROS_MASTER_URI=http://lunar:11311
 +
jeffa@bluemoon:~$ rosrun key_teleop key_teleop.py key_vel:=cmd_vel
 +
jeffa@lunar:~$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
 +
 
 +
</source>
 +
 
 +
http://answers.ros.org/question/206490/how-can-i-control-my-gazebo-model-using-keyboard/
 +
 
 +
[http://gazebosim.org/tutorials?tut=ros_gzplugins Tutorial: Using Gazebo plugins with ROS]
 +
 
 +
http://wiki.ros.org/teleop_tools
 +
 
 +
https://github.com/ros-controls/control_msgs
 +
 
 +
[https://github.com/ros-teleop/teleop_twist_keyboard ros-teleop/teleop_twist_keyboard]
 +
 
 +
<source lang="bash">
 +
jeffa@lunar:~$ export HUSKY_GAZEBO_DESCRIPTION=$(rospack find husky_gazebo)/urdf/description.gazebo.xacro
 +
jeffa@lunar:~$ roslaunch husky_gazebo husky_empty_world.launch
 +
...
 +
jeffa@lunar:~$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
 +
jeffa@lunar:~$ rosservice list
 +
jeffa@lunar:~$ rosrun controller_manager controller_manager list-types
 +
jeffa@lunar:~$ less ~/git/husky/husky_gazebo/launch/husky_empty_world.launch
 +
 
 +
</source>
 +
 
 +
jeffa@lunar:~/.gazebo$ less ~/git/husky/husky_gazebo/launch/husky_empty_world.launch
 +
 
 +
<source lang="bash">
 +
<launch>
 +
 
 +
  <arg name="world_name" default="worlds/empty.world"/>
 +
 
 +
  <arg name="laser_enabled" default="true"/>
 +
  <arg name="kinect_enabled" default="false"/>
 +
 
 +
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
 +
    <arg name="world_name" value="$(arg world_name)"/> <!-- world_name is wrt GAZEBO_RESOURCE_PATH environment variable -->
 +
    <arg name="paused" value="false"/>
 +
    <arg name="use_sim_time" value="true"/>
 +
    <arg name="gui" value="true"/>
 +
    <arg name="headless" value="false"/>
 +
    <arg name="debug" value="false"/>
 +
  </include>
 +
 
 +
  <include file="$(find husky_gazebo)/launch/spawn_husky.launch">
 +
    <arg name="laser_enabled" value="$(arg laser_enabled)"/>
 +
    <arg name="kinect_enabled" value="$(arg kinect_enabled)"/>
 +
  </include>
 +
 
 +
</launch>
 +
</source>
 +
 
 +
==Gazebo==
 +
After many days and endless searches I may have found [https://en.wikipedia.org/wiki/El_Dorado El Dorado] Well El Dorado for ROS; [http://gazebosim.org/tutorials?cat=connect_ros Connect to ROS] in Gazebo Tutorials
 +
 
 +
http://gazebosim.org/tutorials?tut=ros_overview
 +
 
 +
<source lang="bash">
 +
rosrun gazebo_ros gazebo
 +
rosrun gazebo_ros gzserver
 +
rosrun gazebo_ros gzclient
 +
rosrun gazebo_ros spawn_model
 +
rosrun gazebo_ros perf
 +
rosrun gazebo_ros debug
 +
</source>
 +
 
 +
===Husky===
 +
<source lang="bash">
 +
jeffa@lunar:~$ export HUSKY_GAZEBO_DESCRIPTION=$(rospack find husky_gazebo)/urdf/description.gazebo.xacro
 +
jeffa@lunar:~$ export GAZEBO_RESOURCE_PATH=/home/jeffa/git/gazebo_ros_pkgs/gazebo_plugins/test2/worlds/
 +
jeffa@lunar:~$ source ~/catkin_ws/devel/setup.bash
 +
jeffa@lunar:~$ roslaunch husky_gazebo husky_empty_world.launch
 +
 
 +
 
 +
jeffa@lunar:~$ gedit `(find ./ -name husky_empty_world.launch)`
 +
jeffa@lunar:~$ rosrun controller_manager controller_manager list-types
 +
jeffa@lunar:~$ rosrun gazebo_ros debug
 +
 
 +
 
 +
</source>

Latest revision as of 21:48, 5 June 2017

Robot Operating System

At the time this page primarily exists to jog my memory of specific commands and resources as I drink from the initial fire hose of learning ROS. I'm staring my learning with debian 9 stretch on an HP tx2000 notebook with a full desktop install of ROS lunar. And a partial install on a BeagleBone Blue.

In the following lunar is an HP tx2000 notebook, bluemoon is the BBBlue.

Resources

shell commands

* jeffa@lunar:~$ export ROS_MASTER_URI=http://lunar:11311
* jeffa@lunar:~$ source ~/catkin_ws/devel/setup.bash

* jeffa@lunar:~$ rosrun roscpp_tutorials listener
* jeffa@lunar:~$ rosrun roscpp_tutorials  talker
* jeffa@lunar:~$ roscd roscpp_tutorials

turtlesim

jeffa@lunar:~$ rosrun turtlesim turtlesim_node
jeffa@lunar$ rosrun turtlesim turtle_teleop_key

jeffa@bluemoon:~$ export ROS_MASTER_URI=http://lunar:11311
jeffa@bluemoon$ rosrun turtlesim turtle_teleop_key

Guides

gazebo key_teleop rover

using keyboard to control the robot in gazebo. answers.ros.org

jeffa@bluemoon:~$ export ROS_MASTER_URI=http://lunar:11311
jeffa@bluemoon:~$ rosrun key_teleop key_teleop.py key_vel:=cmd_vel
jeffa@lunar:~$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

http://answers.ros.org/question/206490/how-can-i-control-my-gazebo-model-using-keyboard/

Tutorial: Using Gazebo plugins with ROS

http://wiki.ros.org/teleop_tools

https://github.com/ros-controls/control_msgs

ros-teleop/teleop_twist_keyboard

jeffa@lunar:~$ export HUSKY_GAZEBO_DESCRIPTION=$(rospack find husky_gazebo)/urdf/description.gazebo.xacro
jeffa@lunar:~$ roslaunch husky_gazebo husky_empty_world.launch
...
jeffa@lunar:~$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
jeffa@lunar:~$ rosservice list
jeffa@lunar:~$ rosrun controller_manager controller_manager list-types
jeffa@lunar:~$ less ~/git/husky/husky_gazebo/launch/husky_empty_world.launch

jeffa@lunar:~/.gazebo$ less ~/git/husky/husky_gazebo/launch/husky_empty_world.launch

<launch>

  <arg name="world_name" default="worlds/empty.world"/>

  <arg name="laser_enabled" default="true"/>
  <arg name="kinect_enabled" default="false"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(arg world_name)"/> <!-- world_name is wrt GAZEBO_RESOURCE_PATH environment variable -->
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="true"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
  </include>

  <include file="$(find husky_gazebo)/launch/spawn_husky.launch">
    <arg name="laser_enabled" value="$(arg laser_enabled)"/>
    <arg name="kinect_enabled" value="$(arg kinect_enabled)"/>
  </include>

</launch>

Gazebo

After many days and endless searches I may have found El Dorado Well El Dorado for ROS; Connect to ROS in Gazebo Tutorials

http://gazebosim.org/tutorials?tut=ros_overview

rosrun gazebo_ros gazebo
rosrun gazebo_ros gzserver
rosrun gazebo_ros gzclient
rosrun gazebo_ros spawn_model
rosrun gazebo_ros perf
rosrun gazebo_ros debug

Husky

jeffa@lunar:~$ export HUSKY_GAZEBO_DESCRIPTION=$(rospack find husky_gazebo)/urdf/description.gazebo.xacro 
jeffa@lunar:~$ export GAZEBO_RESOURCE_PATH=/home/jeffa/git/gazebo_ros_pkgs/gazebo_plugins/test2/worlds/
jeffa@lunar:~$ source ~/catkin_ws/devel/setup.bash
jeffa@lunar:~$ roslaunch husky_gazebo husky_empty_world.launch


jeffa@lunar:~$ gedit `(find ./ -name husky_empty_world.launch)`
jeffa@lunar:~$ rosrun controller_manager controller_manager list-types
jeffa@lunar:~$ rosrun gazebo_ros debug