ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

How do macOS users develop with ROS2?

asked 2020-09-07 18:01:26 -0500

33thou gravatar image

updated 2020-09-08 11:24:23 -0500

Is anyone using macOS as their development machine and creating ROS-based software targeting Ubuntu?

I'd like to be able to at least use tools like rqt_bag and rviz to visualize and analyze data, and if possible also create sample data bags.

Running ROS locally and installed e.g. with brew or compiled would be great, but that doesn't seem possible (at least without disabling SIP and running an old version of macOS, both blockers):

I've also struggled to find any libraries that read/write/replay rosbags without depending on the whole ROS ecosystem. For example:

Considered running the tools inside a VM but that will not be a very efficient day-to-day developer experience. Setting up a second dev machine is possible but cumbersome and not scalable for a team. Docker would work for some needs, but doesn't help with the GUI tools.

How are other developers and teams interacting with ROS from their macOS dev machines, particularly with Python? Thank you for your guidance!

edit retag flag offensive close merge delete

Comments

https://github.com/rospypi/simple # still seems to require a ROS pub/sub server running?

Not for reading/writing .bags.

What's a "ROS pub/sub server" btw?

Not sure how you would "replay rosbags" without having a ROS master active and some nodes, but that would probably depend on your definition of replay.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-08 02:19:16 -0500 )edit

What's a "ROS pub/sub server" btw?

Sorry, I'm still getting familiar with the terminology. When I tried running pspypi/simple it expected a ROS_MASTER server running at http://localhost:11311

33thou gravatar image 33thou  ( 2020-09-08 11:10:20 -0500 )edit

If you create a node: yes, you need a master.

But for working with .bags, that's not needed.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-08 11:12:18 -0500 )edit

okay good to know thanks! I'll investigate further.

depend on your definition of replay

My goal is to run rqt_bag and rviz using macos on both pre-recorded and simulated data

33thou gravatar image 33thou  ( 2020-09-08 11:20:16 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-09-18 09:57:50 -0500

Hi, I've compiled ROS bare-bone packages on my macOS. and I've managed to run rqt tools.

Basically what I did is, create a catkin_ws/src/ and under src/ I've added all the bare-bone packages, rospy roscpp topic_tools image_tools rqt_gui ... etc

and configured the workspace, such that the -DPYTHON_LIBRARY -DPYTHON_INCLUDE_DIR arguments were set, and also configured the install space as /opt/ros/melodic

Here is how my catkin_ws/.catkin_tools/profiles/default/build.yaml file looks like:

blacklist: []
build_space: build
catkin_make_args: []
cmake_args:
- -DCMAKE_FIND_FRAMEWORK=LAST
- -DCATKIN_ENABLE_TESTING=1
- -DCMAKE_BUILD_TYPE=Release
- -DPYTHON_LIBRARY=/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
- -DPYTHON_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
- -DPYTHON3_LIBRARY=/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib
- -DPYTHON3_INCLUDE_DIR=/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m
- -DCMAKE_CXX_FLAGS= -DQT_MAC_USE_COCOA
- -DCMAKE_CXX_STANDARD=14
devel_layout: linked
devel_space: devel
extend_path: null
install: true
install_space: /opt/ros/melodic
isolate_install: false
jobs_args: []
log_space: logs
make_args: []
needs_force: false
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: []

Esentially, the .rosinstall file contains every package that is in bare bones or desktop-full bundles. The was i've downloaded all of the packages is with the following script. The reason I've used this script instead of the default method with rosinstall command is i had SSL issues with my computer, so the rosinstall continuously failed to download those packages I had to write my own ... (I know I know .. :) )

import yaml
stream = open("melodic-tf.rosinstall", 'r+').read()
arr = yaml.safe_load(stream)


import os
if not os.path.isdir("./download_folder"):
    os.mkdir("./download_folder")

os.chdir("./download_folder") cur_path =
os.path.dirname(os.path.realpath(__file__))

for elem in arr:
    if "tar" in elem.keys():
        name = elem["tar"]["local-name"]
        uri = elem["tar"]["uri"]
        download_name = uri.split("/")[-1]

        os.system("mkdir -p " + name)

        os.chdir(name)
        os.system("wget " + uri)
        os.system("tar -xvf " + download_name)
        _list = os.listdir(".")
        selected_name = ""
        for l in _list:
            if l != download_name:
                selected_name = l
        os.system("mv ./" + selected_name + "/* .")
        os.system("rm -rf " + selected_name)

        os.chdir(cur_path)

    elif "git" in elem.keys():
        name = elem["git"]["local-name"]
        uri = elem["git"]["uri"]
        ver = elem["git"]["version"]

        os.system("git clone " + uri + " " + name)
        os.chdir(name)
        os.system("git checkout " + ver)
        os.chdir(cur_path)

After I've downloaded everything and configured the catkin as described above, all i had to do was very simple and easy and just run catkin build, which resulted in about 100 errors to fix :D You'll need to install boost and other required libraries through homebrew, which I searched on google to how to install one by one, as I got more erros. And finally, all the compilations were successful, I just sourced /opt/ros/melodic/setup.bash, and moved on.

You can ask more details (package library versions etc etc) if you want as i still use that setup.

BTW this is not the easiest installation, you can definitely work with brew installation method on the official ros site, idk why I've choosen this way :)

Note: I know ... (more)

edit flag offensive delete link more

Comments

Hi @SencerYazici - thanks so much for following up from my question on Reddit and posting this!

As you noted, it's for ROS and not ROS2, but there's still some valuable information here. In particular, the cmake_args seem quite important.

33thou gravatar image 33thou  ( 2020-09-20 17:51:54 -0500 )edit
0

answered 2021-07-31 08:47:40 -0500

RobotDreams gravatar image

updated 2021-07-31 09:16:10 -0500

I'm with you there, with Mac as my desktop. At the moment (July 2021), I have installed

  • Ubuntu 20.04 Desktop and ROS2 Foxy in a VMware Fusion virtual machine, and
  • Run rviz2 (with joint_state and robot_state publishers), and rqt on that desktop to view my
  • Raspberry Pi based GoPiGo3 ROS2 robot (running Ubuntu 20.04 64-bit Server and ROS2 Foxy).
  • ros2 bag [record <topic> | info <file> | play <file> are working

Gazebo Classic crashes the desktop VM, possibly because I have an eGPU in addition to the 2018 MacMini internal GPU. I plan to try Ignition Gazebo to see if it will work better.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-09-07 18:01:26 -0500

Seen: 683 times

Last updated: Jul 31 '21