Skip to content

FlowersGD/ROS2-Codespaces-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

ROS in Codespaces

Stolen from the ROS website.

Enable required repositories

sudo apt update && sudo apt install curl -y
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb"
sudo dpkg -i /tmp/ros2-apt-source.deb

Install ROS2

sudo apt install ros-rolling-desktop

Setup environment

Set up your environment by sourcing the following file:
source /opt/ros/rolling/setup.bash

Check environment variables

Sourcing ROS 2 setup files will set several environment variables necessary for operating ROS 2. If you ever have problems finding or using your ROS 2 packages, make sure that your environment is properly set up using the following command:
printenv | grep -i ROS

Try some examples

If you installed ros-rolling-desktop above you can try some examples.

In one terminal, source the setup file and then run a C++ talker:

source /opt/ros/rolling/setup.bash
ros2 run demo_nodes_cpp talker

In another terminal source the setup file and then run a Python listener:

source /opt/ros/rolling/setup.bash
ros2 run demo_nodes_py listener

You should see the talker saying that it’s Publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly. Hooray!

TurtleSim tutorial

Found here

sudo apt install ros-rolling-turtlesim

ros2 pkg executables turtlesim

ros2 run turtlesim turtlesim_node

Get this error?

ros2 run turtlesim turtlesim_node
/opt/ros/rolling/lib/turtlesim/turtlesim_node: symbol lookup error: /opt/ros/rolling/lib/turtlesim/turtlesim_node: undefined symbol: _ZN13rclcpp_action20ServerGoalHandleBase12try_abortingEv
[ros2run]: Process exited with failure 127

A discussion about the cause is here: https://answers.ros.org/question/380917/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published