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.
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:
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.
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.
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.