You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to manage the remote start of my guidance system, but I can't find the command. I'm getting a compiler error. I don't know how to properly manage the class.
I'm learning how to use this library every day.
#include"isobus/hardware_integration/can_hardware_interface.hpp"
#include"isobus/hardware_integration/twai_plugin.hpp"
#include"isobus/isobus/can_general_parameter_group_numbers.hpp"
#include"isobus/isobus/can_network_manager.hpp"
#include"isobus/isobus/can_partnered_control_function.hpp"
#include"isobus/isobus/can_stack_logger.hpp"
#include"isobus/isobus/isobus_virtual_terminal_client.hpp"
#include"isobus/isobus/isobus_virtual_terminal_client_update_helper.hpp"
#include"isobus/utility/iop_file_interface.hpp"
#include"isobus/hardware_integration/available_can_drivers.hpp"
#include"isobus/hardware_integration/available_can_drivers.hpp"
#include"isobus/isobus/isobus_standard_data_description_indices.hpp"
#include"isobus/isobus/isobus_task_controller_client.hpp"
#include"isobus/isobus/isobus_guidance_interface.hpp"
#include"console_logger.cpp"
#include"section_control_implement_sim.hpp"
#include"freertos/FreeRTOS.h"
#include"freertos/timers.h"
#include<functional>
#include<iostream>
#include<memory>//! It is discouraged to use global variables, but it is done here for simplicity.static std::shared_ptr<isobus::TaskControllerClient> TestTCClient = nullptr;
static std::atomic_bool running = { true };
// Define el pin del LED
#defineLED_PIN GPIO_NUM_2
#defineBOOT_BUTTON_GPIO GPIO_NUM_0 // Pin asociado al botón BOOTvoidconfigure_led_pin()
{
// Configurar el pin LED como sal idagpio_set_direction(LED_PIN, GPIO_MODE_OUTPUT);
gpio_set_level(LED_PIN, 0); // Asegurarse de que el LED esté apagado al inicio//configuracion Botongpio_config_t io_conf = {};
io_conf.pin_bit_mask = (1ULL << BOOT_BUTTON_GPIO);
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pull_up_en = GPIO_PULLUP_ENABLE; // Activar resistencia pull-upgpio_config(&io_conf);
}
extern"C"voidapp_main()
{ configure_led_pin ();
isobus::CANNetworkManager::CANNetwork.get_configuration().set_number_of_packets_per_dpo_message(255);
isobus::CANNetworkManager::CANNetwork.get_configuration().set_number_of_packets_per_cts_message(255);
// Automatically load the desired CAN driver based on the available driverstwai_general_config_t twaiConfig = TWAI_GENERAL_CONFIG_DEFAULT(GPIO_NUM_21, GPIO_NUM_22, TWAI_MODE_NORMAL);
twai_timing_config_t twaiTiming = TWAI_TIMING_CONFIG_250KBITS();
twai_filter_config_t twaiFilter = TWAI_FILTER_CONFIG_ACCEPT_ALL();
std::shared_ptr<isobus::CANHardwarePlugin> canDriver = std::make_shared<isobus::TWAIPlugin>(&twaiConfig, &twaiTiming, &twaiFilter);
isobus::CANStackLogger::set_can_stack_logger_sink(&logger);
isobus::CANStackLogger::set_log_level(isobus::CANStackLogger::LoggingLevel::Info); // Change this to Debug to see more informationisobus::CANHardwareInterface::set_number_of_can_channels(1);
isobus::CANHardwareInterface::assign_can_channel_frame_handler(0, canDriver);
//isobus::CANHardwareInterface::set_periodic_update_interval(10); // 10ms update period matches the default FreeRTOS tick rate of 100Hzif (!isobus::CANHardwareInterface::start() || !canDriver->get_is_valid())
{
ESP_LOGE("AgIsoStack", "Failed to start hardware interface, the CAN driver might be invalid");
}
isobus::NAME TestDeviceNAME(0);
//! Make sure you change these for your device!!!!
TestDeviceNAME.set_arbitrary_address_capable(true);
TestDeviceNAME.set_industry_group(2);
TestDeviceNAME.set_device_class(6);
TestDeviceNAME.set_function_code(static_cast<std::uint8_t>(isobus::NAME::Function::SteeringControl));
TestDeviceNAME.set_identity_number(2);
TestDeviceNAME.set_ecu_instance(0);
TestDeviceNAME.set_function_instance(0);
TestDeviceNAME.set_device_class_instance(0);
TestDeviceNAME.set_manufacturer_code(1407);
auto TestInternalECU = isobus::CANNetworkManager::CANNetwork.create_internal_control_function(TestDeviceNAME, 0);
isobus::AgriculturalGuidanceInterface TestGuidanceInterface(TestInternalECU, nullptr);
TestGuidanceInterface.initialize();
bool guidanseStatus=false;
while (true)
{
int button_state = gpio_get_level(BOOT_BUTTON_GPIO);
if (button_state == 0)
{ // Estado bajo: botón presionadoif (guidanseStatus)
{
TestGuidanceInterface.set_guidance_system_remote_engage_switch_status(GenericSAEbs02SlotValue Off);
guidanseStatus=false;
}
else
{
TestGuidanceInterface.set_guidance_system_remote_engage_switch_status(GenericSAEbs02SlotValue on);
guidanseStatus=true;
}
}
}
TestTCClient->terminate();
isobus::CANHardwareInterface::stop();
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to manage the remote start of my guidance system, but I can't find the command. I'm getting a compiler error. I don't know how to properly manage the class.
I'm learning how to use this library every day.
Beta Was this translation helpful? Give feedback.
All reactions