Skip to content

Commit 1c18cae

Browse files
authored
[ Minor Updates ] : Python path update and README changes (#72)
* Python Path update for python scripts, Cmakelist changes for module inclusions in 4_simulation_gazebo * README changes for firmware/4_microros_gazebo for more clear instructions. * Python path updated after testing * Update README.md README instruction changes * Update talker.py * Update inverse_kinematics.py
1 parent f6ccff5 commit 1c18cae

File tree

8 files changed

+21
-19
lines changed

8 files changed

+21
-19
lines changed

1_chatter_listener/scripts/listener.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/python3
22
# MIT License
33

44
# Copyright (c) 2024 Society of Robotics and Automation

1_chatter_listener/scripts/talker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/python3
22
# MIT License
33

44
# Copyright (c) 2024 Society of Robotics and Automation

2_simulation_dh/scripts/broadcaster.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/python3
22
import rclpy
33
from rclpy.node import Node
44

3_simulation_rviz/scripts/rviz.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# #!/usr/bin/env python3
1+
#!/usr/bin/python3
22
import rclpy
33
from rclpy.node import Node
44
from sensor_msgs.msg import JointState

4_simulation_gazebo/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ find_package(robot_state_publisher REQUIRED)
2929
# DESTINATION lib/${PROJECT_NAME}
3030
# )
3131
install(PROGRAMS
32-
scripts/forward_kinematics.py scripts/inverse_kinematics.py
32+
scripts/forward_kinematics.py scripts/inverse_kinematics.py scripts/forward_kinematics_module.py scripts/inverse_kinematics_module.py
3333
DESTINATION lib/${PROJECT_NAME}
3434
)
3535
install(

4_simulation_gazebo/scripts/forward_kinematics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/python3
22
# -*- coding: utf-8 -*-
33
import rclpy
44
from rclpy.node import Node

4_simulation_gazebo/scripts/inverse_kinematics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/python3
22
import rclpy
33
from rclpy.node import Node
44
import inverse_kinematics_module
@@ -74,4 +74,4 @@ def inverse_kinematics_publisher():
7474
node = Node('inverse_kinematics_publisher')
7575
node.create_timer(0.2, inverse_kinematics_publisher)
7676
rclpy.spin(node)
77-
rclpy.shutdown()
77+
rclpy.shutdown()

firmware/4_microros_gazebo/README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
2121
* ``` cd MARIO/firmware/4_microros_gazebo ```
2222
* ```$IDF_PATH/export.sh``` (or ```get_idf``` if you have set up the alias in your `.bashrc` file)
2323

24-
* Configure the micro-ROS settings
25-
* ```idf.py menuconfig```
26-
* inside `micro-ROS Settings` Set up WiFi configuration (SSID and Password) and your IP address in micro-ROS Agent IP (can be found by `ifconfig` command)
24+
* Configure the micro-ROS settings using ```idf.py menuconfig```
25+
26+
* Inside micro-ROS Settings Set up WiFi configuration (SSID and Password)
27+
* IP address of host PC in micro-ROS Agent IP (can be found by `ifconfig` command)
28+
* Make sure micro_ros port is same as given to the agent in previous command.
2729

2830
**Note** If it shows the error `ifconfig: command not found`, install the package `net-tools` by following command:
2931

@@ -37,20 +39,20 @@ sudo apt install net-tools
3739

3840

3941

40-
* In another terminal, Navigate to the ROS2 workspace and Start the Publisher by executing the relevant python script after sourcing the environment
42+
* In another terminal, Navigate to the ROS2 workspace and Start the Publisher by executing the relevant python script after sourcing ros2 in the environment
4143
(Make sure you have previously built the folder by executing `colcon build` command with 4_simulation_gazebo in the src folder):
4244

4345
```bash
44-
cd ros2_ws/
46+
cd ros2_ws
4547
source install/setup.bash
46-
ros2 run simulation_gazebo forward_kinematics.py
48+
ros2 launch simulation_gazebo basic_gazebo.launch.py
4749
```
48-
* You can also run inverse_kinematics.py using above command
49-
50-
**Note**:- If it shows the error that script is not executable, run the following command in the directory where the script is present.
51-
50+
This will open a gazebo simulation window.
51+
Now we run kinematics scripts on the bot. Open a new terminal and run following commands.
5252
```bash
53-
sudo chmod +x forward_kinematics.py
53+
cd ros2_ws
54+
source install/setup.bash
55+
ros2 run simulation_gazebo forward_kinematics.py
5456
```
5557

5658
* Enter the angles on the publisher side and voila! See your manipulator moving!

0 commit comments

Comments
 (0)