55This repository is aimed to be used with its public API the
66[ linear_feedback_controller_msgs] ( https://github.com/loco-3d/linear-feedback-controller-msgs ) .
77
8- These two package are under the license [ BSD-2 license] ( ./LICENSE ) .
8+ These two packages are under the license [ BSD-2 license] ( ./LICENSE ) .
99
10- The current versions of this 2 package can be found in their respective ` package.xml ` file.
10+ The current versions of these two packages can be found in their respective
11+ ` package.xml ` file. There ** must** be an associated git tag in a shape of vX.Y.Z.
1112
1213Follows a quick description of these package.
1314
@@ -18,137 +19,84 @@ controller.
1819It is implementing a chainable controller pluggable with any kind of state
1920estimator.
2021
21- We implement a ROS 2 action client/server setup.
22- We send a request with:
22+ We implement a ROS 2 topic publisher sending:
2323- base configuration (only if the robot has a free-flyer, identity otherwise)
2424- base velocity (only if the robot has a free-flyer, identity otherwise)
2525- joint positions
2626- joint velocities
2727- joint efforts (torques applied to the joints)
2828
29- We send receive the response in the shape:
29+ We send receive the response via a topic in the shape:
3030- A feedback gain matrix
3131- A feedforward term in torque
32- - The state which was used to linearize the control.
32+ - The state which was sent before used to linearize the control.
3333
3434This allows us, for example, to use it on the Talos (1 and 3) robots with a remote controller
3535using a whole body model predictive control based on [ croccodyl] ( https://github.com/loco-3d/crocoddyl )
3636
3737## The linear_feedback_controller_msgs
3838
3939[ This package] ( https://github.com/loco-3d/linear-feedback-controller-msgs ) contains the external user interface to the linear_feedback_controller
40- package. It describes the sensor data exchanged in the previously cited RosTopics .
40+ package. It describes the sensor data exchanged in the previously cited ROS2 topics .
4141
4242And in particular it offers a very simple ROS/[ Eigen] ( https://eigen.tuxfamily.org/index.php?title=Main_Page )
43- conversion. This is made to facilitate further computations with the Sensor
44- data. And ease to fill in the Control message.
43+ conversion tooling.
44+ And a ROS/[ numpy] ( https://numpy.org/ ) conversion tooling.
45+ These are made to facilitate further computations with the Sensor data,
46+ and ease to fill in the Control message.
4547
4648Please check the [ README.md] ( https://github.com/loco-3d/linear-feedback-controller-msgs/blob/main/README.md ) of the package for more details.
4749
4850## Example of usage
4951
50- ### Requirements
52+ This a ROS2 controller so on can simply look at the ROS2 control documentation.
53+ An example of configuration can be found
54+ [ in this repository here] ( ./config/tiago_pro_lfc_params.yaml ) .
5155
52- For this example you need to have access to the dockers in https://gitlab.laas.fr/gsaurel/docker-pal/ .
53- This is a private repository so one need to be part of the LAAS-CNRS french laboratory.
54- Further development will provide a new public image in order to use this code in simulation.
56+ The example is extracted from the agimus-demos pacakges:
57+ https://github.com/agimus-project/agimus-demos
5558
56- ### Build the repository using ROS and docker .
59+ And in particular the setup of the LFC is in the ` agimus_demos_common ` package .
5760
58- First of all build or pull the docker from https://gitlab.laas.fr/gsaurel/docker-pal/
59- using the branch ` gsaurel ` .
61+ ### Build the package.
6062
61- ```
62- docker pull gitlab.laas.fr:4567/gsaurel/docker-pal:gsaurel
63- ```
64-
65- Then run the docker and mount (` -v ` docker option) the ` src ` and ` build ` folder
66- of your workspace in order to get some cache between to run of the container:
67-
68- ```
69- chown -R :gepetto $(YOUR_WS) # you might need sudo if you get errors here
70- chmod -R g+rwX $(YOUR_WS) # you might need sudo if you get errors here
71- xhost +local:
72- docker run --rm -v $(YOUR_WS)/src:/ws/src -v $(PWD)/Makefile:/ws/Makefile -v /home/$(USER)/devel:/home/user/devel -v $(YOUR_WS)/build:/ws/build --gpus all --net host -e DISPLAY -it gitlab.laas.fr:4567/gsaurel/docker-pal:gsaurel
73- ```
63+ This package is base on ament_cmake hence one can simply use the standard:
7464
75- If you need another terminal to connect to the last docker container ran you can use:
76- ```
77- docker exec --workdir=/ws -u user -it `docker ps --latest --quiet` bash
65+ ``` bash
66+ git clone https://github.com/loco-3d/linear-feedback-controller.git
67+ cd linear-feedback-controller
68+ make _build
69+ cd _build
70+ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/your/install/folder
71+ make
72+ make install
7873```
7974
80- Once connected to docker with multiple terminal (5) please run in order :
75+ Or one can use the ROS2 super build system [ colcon ] ( https://colcon.readthedocs.io/en/released/ ) :
8176
82- - Terminal 1: Start the simulation:
83- ```
84- reset && catkin build linear_feedback_controller && source install/setup.bash && roslaunch talos_pal_physics_simulator talos_pal_physics_simulator_with_actuators.launch robot:=full_v2
77+ ``` bash
78+ mkdir -p workspace/src
79+ git -C workspace/src clone https://github.com/loco-3d/linear-feedback-controller.git
80+ colcon build
8581```
8682
87- - Terminal 2: Spawn the default controller:
83+ One can also use [ nix] ( https://nixos.org/ ) to:
84+ - Check the package (builds and run tests):
85+ ``` bash
86+ git clone https://github.com/loco-3d/linear-feedback-controller.git
87+ cd linear-feedback-controller
88+ nix flake check -L
8889```
89- reset && source install/setup.bash && roslaunch talos_controller_configuration default_controllers.launch
90- ```
91- in the same terminal, once the robot is in the default pose, kill (` ctrl+C ` ) the roslaunch
92-
93- - Terminal 3: Spawn the linear feedback controller:
94- ```
95- reset && source install/setup.bash && roslaunch linear_feedback_controller talos_linear_feedback_controller.launch simulation:=true default_params:=true
96- ```
97-
98- - Terminal 4: For recording logs you can use ` rosbag ` :
99- ```
100- reset && source install/setup.bash && rosbag record -o src/lfc /linear_feedback_controller/sensor_state /linear_feedback_controller/desired_control
101- ```
102-
103- - Terminal 5: For starting a very simple PD controller via Feedback gains run:
104- ```
105- reset && source install/setup.bash && rosrun linear_feedback_controller pd_controller
106- ```
107-
108- The next paragraph is the same procedure except one can use the Makefile that is
109- in the root of this repos to do so.
110-
111- ### Build the repository using make
112-
113- There is also [ Makefile] ( Makefile ) to ease the usage of docker and ROS instructions
114- in order to execute the demo.
115-
116- - Create the workspace and clone the repository
117- ```
118- mkdir -p ~/devel/workspace/src
119- cd ~/devel/workspace/src
120- git clone --recursive git@github.com:loco-3d/linear-feedback-controller.git
121- ```
122-
123- - Run the docker and build in terminal(1)
124- ```
125- cd ~/devel/workspace/src/linear_feedback_controller
126- make docker_pull_and_run
127- make build
128- ```
129-
130- - Run the simulation, terminal(1)
131- ```
132- make simu
133- ```
134-
135- - Run the default controller and kill it (ctrl+C) when the robot is in half-sitting terminal(2)
136- ```
137- make docker_connect
138- make default_ctrl
139- ```
140-
141- - Run the linear feedback controller terminal (2)
142- ```
143- make lf_ctrl
144- ```
145-
146- - Run the PD controller using the lfc terminal (3)
90+ - Build the package:
91+ ``` bash
92+ nix build -L
14793```
148- make docker_connect
149- make pd_ctrl
94+ - Create a shell in which the LFC can be built:
95+ ``` bash
96+ nix develop
15097```
15198
99+ Alternatively, you can use [ nix-direnv] ( https://github.com/nix-community/nix-direnv/ ) to automatically activate the development environment
152100### Copyrights and License
153101
154102See the BSD-2 LICENSE file.
0 commit comments