Failed to build connection between ROS backend and rhino 7

Hi, everyone,

I am new to compas_fab and I’m having a few issues with the ROS backend.

I followed all the official guidelines, including checking in VS Code that the ROS backend is connected. However, when I run the same code in the rhino 7 python environment, I get the following message:

Message: object.__init__() takes no parameters

Can anyone tell me why this is? I tried different docker profiles and also saw the model in noVNC (partly provided with WebUI). But I’ve never been able to establish this connection in rhino.

Hi! Could you please post the snippet of code that you’re using and it is failing?
Thx

Hi, Gonzalo,

I used the code from the official document:

from compas_fab.backends import RosClient

with RosClient("localhost") as client:
    print("Connected:", client.is_connected)

Whether I use ‘localhost’ or not, it doesn’t work. Perhaps there is a problem with my computer settings somewhere that is causing this. But I can’t locate it. Virtualisation is also turned on.

Hi! The error indicates a problem at the python level, not your docker or virtualization (both those things are working well, it seems). So, it is a bit of a simpler error, perhaps you haven’t successfully activated/installed the environment into rhino. Correct me if I’m wrong, but I assume that you have created a conda environment in which you installed compas_fab and then you ran python -m compas_rhino.install -v 7.0 to “activate” that on Rhino. In Grasshopper, you can drop an “Info” component (from the COMPAS components), and it will show in the output which environment is activated. Make sure this matches the name of the environment that you expect.

You could also verify all installed versions by running the following in a GHPython component:

import compas
import compas_fab

print("COMPAS", compas.__version__)
print("COMPAS FAB", compas_fab.__version__)

Please run these lines and let me know what you get

Cheers

Hi, Gonzalo,

Initially, I followed the guideline on the official website:

conda create -n project_name -c conda-forge compas_fab

The installed versions of COMPAS and COMPAS_FAB are 2.1.1 and 1.0.2, respectively. However, it seems there is no COMPAS component installed on Rhino. I think I need to install COMPAS 2.7.0 to get the required COMPAS component.

Next, I tried the commands you suggested, and the output information is shown below. The commands worked, but I still cannot load the robot from ROS. Interestingly, when I load the robot from GitHub, it works.

When I try to verify the ROS connection in rhino, the output looks like this. Note that this verification is successful in VS Code.

I also tried reinstalling compas and compas_fab. This time I installed compas 2.7.0 and the compas component appeared in rhino. Its information of the info component is the same as I expected. But I still can’t connect to the ROS backend.

Any update on this? I got a new laptop and have the same problem. Same environment I was using before

Update:
After some trial and error I downgraded roslibpy ==1.7.0 and compas-robots==0.3.0 and now it works for me.
Also the version of compas_fab I am using is 0.27.0.

Hello both of you, I’ve fixed the issue here: Fixed ROS connection issue on IronPython by gonzalocasas · Pull Request #126 · gramaziokohler/roslibpy · GitHub
I will create a new release today, should be available on conda later in the day.

Cheers
Gonzalo