Git Product home page Git Product logo

dsr-graph's Introduction

Join the chat at https://gitter.im/robocomp/robocomp

Docs Links Checker CodeQL Analysis Docker Images Component generation test Component compilation test robocompdsl test

About

An organization maintained by RoboLab (Universidad de Extremadura), Aston University, ISIS (Universidad de Málaga) and many other collaborators from the Google Summer of Code program.

RoboComp is an open-source Robotics framework providing the tools to create and modify software components that communicate through public interfaces. Components may require, subscribe, implement or publish interfaces in a seamless way. Building new components is done using two domain-specific languages, IDSL and CDSL. With IDSL you define an interface and with CDSL you specify how the component will communicate with the world. With this information, a code generator creates C++ and/or Python sources, based on CMake, that compile and execute flawlessly. When some of these features have to be changed, the component can be easily regenerated and all the user-specific code is preserved thanks to a simple inheritance mechanism.

If you already have RoboComp installed, jump to tutorials to start coding!

⚠️ If you want to contribute with something new to Robocomp, please do it on the development branch.

❓ If you have a question please look for it in the FAQ.

Table of contents generated with markdown-toc

Installation from source

Tested in Ubuntu 20.04 and 22.04 Note: RoboComp is not compatible with Ubuntu 16.04. RoboComp needs to be compiled using C++11. Ice libraries with C++11 support are only available for zeroc-ice 3.7 and the packages for this version are only available since Ubuntu 18.04. Note: RoboComp is not compatible with Ubuntu 18.04. RoboComp needs to be compiled using cmake >= 3.16. It's not available in Ubuntu 18.04.

Note: If you have installed Anaconda in your system. Then you need to change the python from anaconda to default.

Prerequisites

Before you begin the installation, make sure you have the following prerequisites installed on your system:

Prerequisites for Robocomp Installation

sudo apt update
sudo apt install python3 python3-pip cmake vim git wget qtbase5-dev libqt5xmlpatterns5-dev libopenscenegraph-dev libgsl-dev 
pip3 install vcstool 

Prerequisites for Compiling Robocomp Components

sudo apt install qt6-base-dev qt6-declarative-dev qt6-scxml-dev libqt6statemachineqml6 libqt6statemachine6 libbz2-dev libssl-dev zeroc-icebox zeroc-ice-all-dev libzeroc-icestorm3.7 libeigen3-dev meld
pip install PySide6 zeroc-ice

Installation Steps

  1. Download the robocomp.repos file:
cd
wget https://raw.githubusercontent.com/robocomp/robocomp2/main/robocomp.repos
  1. Configure environment variables:
echo "export ROBOCOMP=/home/robocomp/robocomp" >> ~/.bashrc
echo "export PATH=\$PATH:/home/$USER/.local/bin" >>  ~/.bashrc
source ~/.bashrc
  1. Import RoboComp packages:
vcs import . < robocomp.repos
  1. Install RoboComp command-line tools:
pushd . && cd robocomp/tools/cli/ && pip install . && popd
sudo ln -s /home/$USER /home/robocomp
cd /home/robocomp/robocomp
ln -s core/cmake cmake
ln -s core/classes classes
mkdir components
sudo ln -s /usr/include/eigen3/Eigen/ /usr/include/Eigen
  1. Add an alias for rcnode to your .bashrc:
echo "alias rcnode='bash /home/robocomp/robocomp/tools/rcnode/rcnode.sh&'" >>  ~/.bashrc
source ~/.bashrc

If you are going to develop with Robocomp it's recommendable to install the following packages too:

sudo apt-get install yakuake qttools5-dev-tools qt5-assistant

Done! Now let's have some fun.

To test RoboComp with Coppelia you need to:

  • Install Coppelia Robotics and Pyrep. There are detailed instructions here
  • Run the bridge, i.e. omniPyrep.py and see that Coppelia starts Ok.
  • Connect your new component to the ports offered in omniPyrep.py or
  • Connect a joystick or XBox pad to omniRep.py using this component

Installing some RoboLab's components from GitHub

The software of the robots using RoboComp is composed of different components working together, communicating among them. What we just installed is just the core of RoboComp (the simulator, a component generator, and some libraries). To have other features like joystick control we have to run additional software components available from other repositories, for example, robocomp-robolab:

cd ~/robocomp/components
git clone https://github.com/robocomp/robocomp-robolab.git

The RoboLab's set of basic robotics components are now downloaded. You can see them in ~/robocomp/components/robocomp-robolab/components

Connecting a JoyStick (if no JoyStick available skip to the next section)

If you have a joystick around, connect it to the USB port and:

cd ~/robocomp/components/robocomp-robolab/components/hardware/external_control/joystickComp
cmake .
make
cd bin
sudo addgroup your-user dialout   // If you find permissions issues in Ubuntu
check the config file in the component's etc folder and make sure that the port matches the DifferentialRobot endpoint in     RCIS.
bin/joystick etc/config

Your joystick should be now running. It will make the robot advance and turn at your will. If it does not work, check where the joystick device file has been created (e.g., /dev/input/js0). If it is not /dev/input/js0, edit ~/robocomp/components/robocomp-robolab/components/hardware/external_control/joystickComp/etc/config change it accordingly and restart. Note that you might want to save the config file to the component's home directory so it does not interfere with future GitHub updates.

Using the keyboard as a JoyStick

If you don't have a JoyStick install this component,

cd ~/robocomp/components/robocomp-robolab/components/hardware/external_control/keyboardrobotcontroller
cmake .
make
src/keyboardrobotcontroller.py etc/config

and use the arrow keys to navigate the robot, the space bar to stop it and 'q' to exit.

Note 1: You must have your simulator running in a terminal and only then you can run a component in another terminal. You will get an error message if you run the above component without having RCIS already running.

Note 2: If you have anaconda installed (for python 3), It is recommended to uninstall anaconda first and then install robocomp. (It is only applicable if you have faced errors while running above commands.)

Testing the installation using the Coppelia Simulator

We are now moving to more advanced robotics simulators that can reduce the gap between simulation and deployment. Our first choice now is CoppeliaSim because it offers a scene editor that can be used during a running simulation, you can "hang" and modify Lua code from the scene nodes in no time, you can choose among 4 physics engines and, thanks to the PyRep library, we have a fast access to almost everything running in the simulator.

Follow the instructions in https://github.com/robocomp/robocomp/blob/development/doc/robocomp-pyrep.md to install CoppeliaSim and PyRep

Next steps

You can find more tutorials on RoboComp in tutorials

Drop comments and ask questions in:

Please, report any bugs with the github issue system: Robocomp Issues

If you have any suggestions to improve the repository, like features or tutorials, please contact us on Join the chat at https://gitter.im/robocomp/robocomp or create a feature request here.

Known issues

  • Compatibility problem between pyparsing version and Robocomp tools:
    • One of the main tools of Robocomp, robocompdsl is using pyparsing and the current code doesn't work with 2.4 version of this library. With the previous commands, we are installing the 2.2 version (python-pyparsing=2.2.0+dfsg1-2). If you have a more recent version of pyparsing installed with apt or pip we recommend you to uninstall it and install the 2.2 version. You can check your current version of pyparsing with this command:
python3 -c "import pyparsing; print(pyparsing.__version__)"
  • Ubuntu 18.04 and CMake > 3.16
    • Robocomp is currently using the syntax for cmake 3.16. It's the default version in Ubuntu 20.04, but it's not available in Ubuntu 18.04.

dsr-graph's People

Contributors

ananabejarano avatar aracelivegamagro avatar aryansethi avatar aschewandern avatar danipeix13 avatar darkgeekms avatar fernan12345 avatar javierdg1996 avatar jmi2k avatar juancarlosgg avatar lucasbonilla26 avatar manju838 avatar noezc avatar orensbruli avatar pawanw17 avatar pbustos avatar pilarbachiller avatar pinedav avatar rcintas avatar varun270 avatar vzccristian avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsr-graph's Issues

Problems with graph_editor 2

It does not allow importing a previously created graph. There is no "Open" option and the config file does not load the input graph.

Error using dsr_api::get_depth_image()

I was trying to get the depth from G using dsr_api::get_depth_image() :

auto cam = G->get_node("viriato_head_camera_sensor");
if (cam.has_value())
{
    const std::vector<float> depth_data = G->get_depth_image(cam.value());
}

But it always throws std::bad_alloc exception in get_depth_image method :

terminate called after throwing an instance of 'std::bad_alloc'
what():  std::bad_alloc
Aborted (core dumped)

Error using DSR agents in Ubuntu 20.04

DSR agents unexpectedly shut down, when trying to run them on Ubuntu 20.04, with no error message.

Only Startup check is printed.

However, when I disable startup check :

this->startup_check_flag = 0;

Everything seems to be running fine :
Screenshot from 2020-08-28 11-48-11

Somehow, the startup check always times out.

Error using dsr_api::insert_node()

I was trying to insert a new node in G using dsr_api::insert_node() in graspDSR component :

// define object node
Node object = Node();
object.type("mesh");
object.name(objectname);
object.agent_id(17);
object.id(id);

// inject object node into graph
auto id = G->insert_node(object);

However, I always get Cannot connect to idserver. Aborting error.

Error while compiling idserver_nogui

No folder with name "graph-related-classes" found

in the CMakeListsSpecific.txt inside idserver_nogui/src
../../../graph-related-classes/CRDT.cpp

viriatoDSR doesn't inject depth into shared graph

Hello,

viriatoDSR component doesn't completely inject RGBD data, passed from viriatoPyrep component.
It only inject RGB data and doesn't inject depth into the shared graph.

Note : In shared graph, depth attribute of RGBD camera refers to number of channels, not depth data.

Problems with yolov4-tracker tutorial

In the tutorial of https://github.com/robocomp/dsr-graph/tree/development/components/yolov4-tracker.

In the section that says "Update the library path in src/CMakeListsSpecific.txt and etc/config by replacing the word REPLACE in both files by the username for correct YOLOv4 library path, using the following commands", it doesn't work running the commands:
sed -i s/REPLACE//g src/CMakeListsSpecific.txt
sed -i s/REPLACE//g etc/config

This is because the word REPLACE is no longer in those files and has been replaced by robocomp / software. It can be confusing.

Problems with DSR tutorial

In the tutorial of https://github.com/robocomp/dsr-graph

In the section where you need to replace TriangleFunctor and Connection.h, we can see the following commands:

sudo cp TriangleFunctor /usr/include/osg

sudo cp Connection.h /usr/include/Ice/Connection.h

but these commands are not completed and fail. This is because we do not have to write TriangleFunctor, but rather the path where the component is located.

  1. install command locate: sudo apt install locate
  2. update the database: sudo updatedb
  3. locate the path of the component TriangleFunctor: locate TriangleFunctor
  4. the screen output gives us the possible paths, use the first one. For example: /home/myuser/robocomp/components/dsr-graph/TriangleFunctor
  5. replace the word "TriangleFunctor" in the command for its path: sudo cp /home/myuser/robocomp/components/dsr-graph/TriangleFunctor /usr/include/osg

We have to do the same for Connection.h but using a path like this "/home/myuser/robocomp/components/dsr-graph/docker/focal/Connection.h": sudo cp /home/myuser/robocomp/components/dsr-graph/docker/focal/Connection.h /usr/include/Ice/Connection.h

I think this explanation could be in the tutorial.

Problems with graph_editor

When I try to delete a node previously created, with a mouse click, the agent crashes. If you select one or more nodes to delete, they are deleted. It only happens with mouse clicks. This is the error that the console shows when the agent crashes:

Epoch time = 0.00094305ms. Fps = 1060389
Epoch time = 0.000936911ms. Fps = 1067337
mousePressEvent >> Taken QGraphicsItem(0x55a161d20650, pos=4.70567,-96.4663, z=-1, flags=(ItemIsMovable|ItemIsSelectable|ItemIsFocusable|ItemUsesExtendedStyleOption|ItemSendsGeometryChanges))
node_combobox_changed
Epoch time = 0.000952249ms. Fps = 1050146
del_node_SLOT : 266
G_del_node 25864407946887188 "uy"
node_combobox_changed
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.

!! 28/06/21 12:19:58.059 bin/graph_editor: error: bad optional access

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.