-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finalized ROS2 Node, only testing left :)
- Loading branch information
Showing
12 changed files
with
369 additions
and
274 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
19 changes: 10 additions & 9 deletions
19
...ruster_interface_asv/include/thruster_interface_asv/thruster_interface_asv_driver_lib.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
// C++ Libraries | ||
#include <algorithm> | ||
#include <fstream> | ||
#include <iostream> | ||
#include <sstream> | ||
#include <stdint.h> | ||
#include <string> | ||
#include <vector> | ||
#include <fstream> | ||
#include <sstream> | ||
#include <iostream> | ||
#include <algorithm> | ||
|
||
#include <fcntl.h> // Used for the O_RDWR define | ||
#include <fcntl.h> // Used for the O_RDWR define | ||
#include <linux/i2c-dev.h> // Used for the I2C_SLAVE define | ||
#include <sys/ioctl.h> | ||
#include <unistd.h> // Used for the close function | ||
#include <unistd.h> // Used for the close function | ||
|
||
|
||
// Declare functions we can use | ||
namespace thruster_interface_asv_driver_lib { | ||
void init(const std::string &pathToCSVFile, int16_t *minPWM, int16_t *maxPWM); | ||
int16_t *drive_thrusters(float *forces); | ||
} // namespace thruster_interface_asv_driver_lib | ||
void init(const std::string& pathToCSVFile, int8_t* thrusterMapping, int8_t* thrusterDirection, int16_t* offsetPWM, int16_t* minPWM, int16_t* maxPWM); | ||
int16_t* drive_thrusters(float* thrusterForces); | ||
} |
8 changes: 6 additions & 2 deletions
8
motion/thruster_interface_asv/include/thruster_interface_asv/thruster_interface_asv_node.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
// C++ Libraries | ||
#include <vector> | ||
|
||
// ROS2 libraries | ||
#include <ament_index_cpp/get_package_share_directory.hpp> | ||
#include <chrono> // For the ROS2 Timer clock | ||
#include <rclcpp/rclcpp.hpp> | ||
#include <std_msgs/msg/float32_multi_array.hpp> | ||
#include <std_msgs/msg/int16_multi_array.hpp> | ||
#include <ament_index_cpp/get_package_share_directory.hpp> | ||
#include <chrono> // For the ROS2 Timer clock | ||
|
||
// Custom libraries | ||
#include <thruster_interface_asv/thruster_interface_asv_driver_lib.hpp> | ||
|
24 changes: 24 additions & 0 deletions
24
motion/thruster_interface_asv/launch/thruster_interface_asv.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from ament_index_python.packages import get_package_share_directory | ||
import os | ||
|
||
def generate_launch_description(): | ||
# Path to the YAML file | ||
yaml_file_path = os.path.join( | ||
get_package_share_directory("thruster_interface_asv"), | ||
"../../../../", # Go to the workspace | ||
"src/vortex-asv/asv_setup/config/robots/", # Go inside where yamal files are located at | ||
"freya.yaml" | ||
) | ||
|
||
return LaunchDescription([ | ||
Node( | ||
package='thruster_interface_asv', | ||
namespace='thruster_interface_asv', | ||
executable='thruster_interface_asv_node', | ||
name='thruster_interface_asv_node', | ||
output='screen', | ||
parameters=[yaml_file_path], | ||
), | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.