hubernikus / nonlinear_obstacle_avoidance

Obstacle avoidance around linear and nonlinear dynamics.
The Unlicense
17 stars 4 forks source link

Implementation guideline #1

Open aniri15 opened 4 months ago

aniri15 commented 4 months ago

Hello, Thanks for posting such a great work. I am somehow confused to get the some results as them in the paper 'Avoidance of Concave Obstacles Through Rotation of Nonlinear Dynamics'. Should I run the code rotational_avoider.py in folder nonlinear_avoidance? Thanks in advance.

hubernikus commented 4 months ago

Hello There are multiple scripts for multiple graphs (and unfortunately some outdated scripts which should be cleaned up). Check out for the spiral-figures: https://github.com/hubernikus/nonlinear_obstacle_avoidance/blob/main/scripts/rotational/example_rotation_paper.py

The tests contain also good examples, e.g., https://github.com/hubernikus/nonlinear_obstacle_avoidance/blob/main/tests/test_rotation_avoidance.py

Check out the bottom of the file to (de-)activate tests.

If you have more information on what exactly you want to replicate/do, I can help further.

aniri15 commented 4 months ago

Hello, Thanks for your reply :) I want to use your posted method for training a robot arm to avoid obstacles in a dynamical environment, and I want to replace the trajectory planning method (DDPG) and my obstacle avoidance method with the ROAM. Would you mind help me with how to add a new environment for 3d human_avoidance task? Thanks in advance.

hubernikus commented 2 months ago

Hello. What kind of information do you have of the human? Do you have the exact limbs? The algorithm works best in combination with other planning algorithms. As the many limbs a human can lead to high curvature of the resulting vector field.

For collision avoidance with a robot with multiple obstacle, and experimentally a human with a Franka we used this implementation: https://github.com/hubernikus/franka_obstacle_avoidance

aniri15 commented 2 months ago

Hello, Thanks for your reply! I want to build an environment with the franka robot arm, and and the collision avoidance example about the human obstacle and franka is very helpful :)

I manged to run the example: human_avoider.py from https://github.com/hubernikus/franka_obstacle_avoidance, but it stuck into a loop of :

RobotZMQ: No state recieved. Awaiting first robot-state.

Is it related to the result of test_communication in https://github.com/hubernikus/simulator-backend.git, which is as following:

Traceback (most recent call last): File "/home/ros2/pybullet_zmq/pybullet_zmq/test_communication.py", line 46, in main() File "/home/ros2/pybullet_zmq/pybullet_zmq/test_communication.py", line 32, in main command = network.receive_command(command_subscriber) File "/usr/local/lib/python3.10/dist-packages/network_interfaces/zmq/network.py", line 273, in receive_command return decode_command(fields) File "/usr/local/lib/python3.10/dist-packages/network_interfaces/zmq/network.py", line 116, in decode_command command = CommandMessage(clproto.decode(message[0]).get_value(), clproto.decode(message[1])) AttributeError: 'state_representation.CartesianState' object has no attribute 'get_value'. Did you mean: 'get_age'?

Thanks in advance.

hubernikus commented 1 month ago

Hello The error results from no robot data being received. Hence, it requires the specific setup of being used together with a franka-emika, which streams its states from a zmq-interface. So a very specific setup, where some code has to be taken from https://github.com/epfl-lasa

However, digging to dep in these codebases might be time-consuming, as a lot of it is at a very 'resarchy/experimental' state, but can be useful for inspiration. Especially the human avoidance part has been rather experimental, and requires further refinement.

However, in my experience, the optimal approach has been dividing the human upper body as an assembly of ellipses and cubes, which have a nonzero overlap region. It depends on your human detection algorithm how this can be achieved. Since the ROAM requires, that all limbs have nonzero overlap.

Beware though, the proposes algorithm is defined for point-masses. For simple scenarios where the robot end-effector can easily be described as a sphere, this can relatively easily be expanded. But if you want to do full-body robot vs full-body human avoidance, it requires some combination of how to evaluate the avoidance for the whole robot, and how to combine the resulting distance. How to optimally do this, remains an open topic to explore.

aniri15 commented 1 month ago

Hi, Thanks for your reply and useful informations. I am currently working on making the whole robot arm avoid obstacles, as the algorithm working on the point model, my plan is to transfer the problem to an optimization problem.

However, I had trouble to understand the psedo code algorithm in 'Avoidance of Concave Obstacles Through Rotation of Nonlinear Dynamics'. If I am not wrong, the algorithm 2, Avoidance of Tree-of-Obstacles, aims to avoid a single general shaped obstacle, which is constructed in alogrithm 4, and construct a convergence direction in alg 3, and if we want to avoide multiple general shaped obstacles, we should use alg 1 with the outputs of alg 2 and alg 3.

Problem:

  1. I am not quite clear how the obstacle is composed, the input and output vectors for alg 4 are weights w_n and initial rotation direction v_n of n parts/ nodes of one decomposed obstacle, how could we append the rotated velocity fc to the tree in alg 2 line 15
  2. how to evaluate rotation tree with input weighting of initial velocity and hiding weights in alg 2 line 20, as the input of alg 4 are weights and rotation directions.
  3. In alg 3 line 5, I did not follow that how to create rotation tree with three rotation vectors as no formula has stated.
  4. In alg 3 line 6, tree reduction with algorithm 1 using vector weight pairs, I did not find the corresponding part.
  5. In alg 3 line 17, tree reduction has applied according to alg 4, but the input of tr is only weight, how to apply tree reduction.
  6. how to use alg 1 to avoide multiple general shaped obstacles.

I appreciate any clarification thanks a lot.